diff options
author | vjeantet <valere.jeantet@gmail.com> | 2020-11-06 01:30:56 +0300 |
---|---|---|
committer | vjeantet <valere.jeantet@gmail.com> | 2020-11-06 01:30:56 +0300 |
commit | b43c043a7b9153e5cf6a1a30b057d143b1cedc52 (patch) | |
tree | 468fe0ce643f24e92c0ed06e6dc587eb52a62c13 | |
parent | 4b0cf57d5be417ddb3167d0bd0b4c09a35c1e62b (diff) |
42 files changed, 730 insertions, 103 deletions
diff --git a/assets/sass/checklist.scss b/assets/sass/checklist.scss index a2eb688..10089d1 100644 --- a/assets/sass/checklist.scss +++ b/assets/sass/checklist.scss @@ -38,6 +38,13 @@ body { } } + h2 a { + //float: left; + + margin-left: 0.2em; + //font-size: 70%; + text-decoration: none; + } div.checklist-footer { @@ -45,6 +52,10 @@ body { margin-bottom: 2em; text-align: center; } + + .zone{ + + } } @@ -52,11 +63,24 @@ body { #TableOfContents > ul li { input { margin-right: 0.3em; + display: none; } - + + i{ + margin-right: 0.3em; + color: #e6e6e6; + &.fa-check-circle{ + color: green; + } + &.fa-dot-circle{ + color: #999999; + } + + } + &:not(.cl-ready):not(.cl-done):not(.cl-doing) { input{ - visibility: hidden; + visibility: hidden; } } @@ -65,6 +89,7 @@ body { visibility: visible; } } + } }
\ No newline at end of file diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 78ac359..ce5d111 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -65,7 +65,7 @@ body{ align-items: stretch ; color:($c_light2); - a { + a, a:hover { color:invert($c_dark2); } > div { @@ -176,11 +176,12 @@ body{ li{ padding: 8px 0px 8px 0px; font-weight:300; + border-bottom: 1px solid transparent; + &.active{ + border-bottom: 1px dashed #999999; + } a { /*padding-left: 2px;*/ - &.active{ - font-weight:500; - } } } diff --git a/assets/sass/shortcodes/notice.scss b/assets/sass/shortcodes/notice.scss index 43f8c4e..88bde5b 100644 --- a/assets/sass/shortcodes/notice.scss +++ b/assets/sass/shortcodes/notice.scss @@ -30,7 +30,7 @@ div.notices { }
ul {}
- label{
+ > label{
font-size: 0.5em;
position: absolute;
margin-left: 0em;
diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-checklist/_index.md b/exampleSite/content/content-and-customization/00-adding-content/page-checklist/_index.md deleted file mode 100644 index af6cd3a..0000000 --- a/exampleSite/content/content-and-customization/00-adding-content/page-checklist/_index.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -date: "2017-04-24T18:36:24+02:00" -description: "" -title: As a Checklist -weight: 190 ---- - -A basic .md file can be rendered as a form/checklist/questionnaire. - -{{% notice %}} -**A page rendered as a Checklist** is a page with a special rendered TOC, and a LOAD/DOWNLAOD form results buttons. -\ -[{{%icon aspect_ratio%}} click here to view an example]({{%ref "checklist/_index.md"%}}) - -{{%/notice%}} - -To tell Hugo to consider a page as a checklist, just add a `checklist: true` in the frontmatter of your page. - -```yaml ---- -checklist: true ---- -``` - -## Demo -[{{%icon aspect_ratio%}} click here to view an example]({{%ref "checklist/_index.md"%}}) - -## Dedicated shortcodes -* c/text - a line or box input type -* c/choices - a radiogroup or a checkboxgroup -* c/list - a select or a multiselect -* c/check - a checkbox -* c/switch - a switch -* c/show - display a part with a condition using user inputs -* c/hidden - set a hidden value diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/_index.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/_index.md new file mode 100644 index 0000000..f8fd798 --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/_index.md @@ -0,0 +1,42 @@ +--- +hidden: true +date: "2017-04-24T18:36:24+02:00" +description: "" +title: As a Skwad +weight: 190 +post: " <span class='badge badge-danger'>beta</span>" +--- + +A basic .md file can be rendered as a form/checklist/questionnaire. + +{{% notice %}} +**A page rendered as a Skwad** is a page with a special rendered TOC, and a LOAD/DOWNLAOD form results buttons. +\ +[{{%icon aspect_ratio%}} click here to view an example]({{%ref "ex-checklist/_index.md"%}}) + +{{%/notice%}} + +To tell Hugo to consider a page as a skwad, just add `skwad` options in the frontmatter of your page. + +```yaml +--- +skwad: + clientside: true # Display Load From File and Save To File buttons + mode: form # set "form" for standard form submission or "api" to use Skwad API + url: https://localhost:5555/ # Form Action URL (mode=form) or Skwad base API (mode=api) + spaceName: appsec # spaceName for Api +--- +``` + +## Dedicated shortcodes +* c/text - a line or box input type +* c/choices - a radiogroup or a checkboxgroup +* c/list - a select or a multiselect +* c/check - a checkbox +* c/switch - a switch +* c/show - display a part with a condition using user inputs +* c/hidden - set a hidden value + +## Examples & Demos + +{{%children style="li" description="true" showhidden="true"%}} diff --git a/exampleSite/content/checklist/__article-sidebar-after.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/__article-sidebar-after.md index 5be235b..a8d29df 100644 --- a/exampleSite/content/checklist/__article-sidebar-after.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/__article-sidebar-after.md @@ -1,8 +1,9 @@ --- --- + <div class="checklist-footer"> <button type="button" - onclick="downloadFile('6d2ab01b-fad4-4e70-83a8-b910ca848fec');" + onclick="skwad.saveDocumentAsFile(skwad.form.getAttribute('ref'));" class="btn btn-success"><i class="fas fa-download"></i> Download Answers</button> </div> diff --git a/exampleSite/content/checklist/_index.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/_index.md index bb45ab4..411e59b 100644 --- a/exampleSite/content/checklist/_index.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/_index.md @@ -1,19 +1,20 @@ --- +description: Very long and Complex example, with file save/load on client side +hidden: true hide: - nextpage -- navs - +- nav +- breadcrumb title: WebApp Security Assessment weight: 99 -checklist: true +skwad: + clientside: true --- - - {{%notice success%}} -This is a demo of a [checklist page]({{%ref "content-and-customization/00-adding-content/page-checklist"%}}) +This is a demo of a [skwad page]({{%ref "content-and-customization/00-adding-content/page-skwad"%}}) {{%/notice %}} ## Application Metadata diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/confirm.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/confirm.md new file mode 100644 index 0000000..12b9670 --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/confirm.md @@ -0,0 +1,11 @@ +--- +hide: +- nextpage + +title: Thank You +weight: 99 +hidden: true + +--- + +Thank You !
\ No newline at end of file diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/test.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/test.md new file mode 100644 index 0000000..5014b1c --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/test.md @@ -0,0 +1,46 @@ +--- +hide: +- nextpage + +title: Test Form +weight: 99 + +checklist: true +--- + +{{<c/hidden _confirmTo `/checklist/confirm?toto=OUI`>}} +{{<c/hidden _errorTo `http://google.fr/checklist/confirm`>}} +{{<c/hidden warn_app_vuln_report_way_no `No external security contact published`>}} + +Name ? +{{<c/text "app_name*" />}} + +A brief description: +{{<c/text "app_description*" multi >}} +Lorem placeholder +{{</c/text>}} + + + +**Do you ?** +{{<c/choices vuln_report_way >}} + * (yes) Yes, we have a published security email contact, or we provide another way for users to report security issues. Incoming reports are timely reviewed and triaged. + * (no) No, we do not currently offer a way to report security vulnerabilities for priority handling. +{{</c/choices>}} + + +{{<c/choices sso_mechanisms multi >}} +* (SAML2) SAML 2.0 +* (OpenIDConnectOAuth2) OpenID Connect / OAuth2 Login +* (OpenID2) OpenID 2.0 +* (LDAP) LDAP / Active Directory +* (other) Other +* (none) None of the above +{{</c/choices >}} + + +<select name="test" multiple=""> + <option>A</option> + <option>B</option> + <option>C</option> +</select> diff --git a/exampleSite/content/checklist/webappsec/01_appmetadata.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/01_appmetadata.md index 5c21612..5c21612 100644 --- a/exampleSite/content/checklist/webappsec/01_appmetadata.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/01_appmetadata.md diff --git a/exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/02_vulnerabilityreporting.md index ac6e5dc..ac6e5dc 100644 --- a/exampleSite/content/checklist/webappsec/02_vulnerabilityreporting.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/02_vulnerabilityreporting.md diff --git a/exampleSite/content/checklist/webappsec/03_https.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/03_https.md index 5a5cae5..5a5cae5 100644 --- a/exampleSite/content/checklist/webappsec/03_https.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/03_https.md diff --git a/exampleSite/content/checklist/webappsec/04_authz.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz.md index 2a31fa5..2a31fa5 100644 --- a/exampleSite/content/checklist/webappsec/04_authz.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz.md diff --git a/exampleSite/content/checklist/webappsec/04_authz_AuthenticationCookiesandSessions.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_AuthenticationCookiesandSessions.md index 32abede..32abede 100644 --- a/exampleSite/content/checklist/webappsec/04_authz_AuthenticationCookiesandSessions.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_AuthenticationCookiesandSessions.md diff --git a/exampleSite/content/checklist/webappsec/04_authz_Authorization.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_Authorization.md index 2563877..2563877 100644 --- a/exampleSite/content/checklist/webappsec/04_authz_Authorization.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_Authorization.md diff --git a/exampleSite/content/checklist/webappsec/04_authz_AuthorizationRelatedWebVulnerabilities.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_AuthorizationRelatedWebVulnerabilities.md index b84d687..b84d687 100644 --- a/exampleSite/content/checklist/webappsec/04_authz_AuthorizationRelatedWebVulnerabilities.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_AuthorizationRelatedWebVulnerabilities.md diff --git a/exampleSite/content/checklist/webappsec/04_authz_OAuth2Login.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_OAuth2Login.md index 2046e05..2046e05 100644 --- a/exampleSite/content/checklist/webappsec/04_authz_OAuth2Login.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_OAuth2Login.md diff --git a/exampleSite/content/checklist/webappsec/04_authz_UsernamePasswordAuthentication.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_UsernamePasswordAuthentication.md index 4f0901e..4f0901e 100644 --- a/exampleSite/content/checklist/webappsec/04_authz_UsernamePasswordAuthentication.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/04_authz_UsernamePasswordAuthentication.md diff --git a/exampleSite/content/checklist/webappsec/05_commonvuln.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln.md index d28f38d..d28f38d 100644 --- a/exampleSite/content/checklist/webappsec/05_commonvuln.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln.md diff --git a/exampleSite/content/checklist/webappsec/05_commonvuln_BrowserPlugins.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_BrowserPlugins.md index e388830..e388830 100644 --- a/exampleSite/content/checklist/webappsec/05_commonvuln_BrowserPlugins.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_BrowserPlugins.md diff --git a/exampleSite/content/checklist/webappsec/05_commonvuln_CrossSiteScripting.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_CrossSiteScripting.md index c7238b7..c7238b7 100644 --- a/exampleSite/content/checklist/webappsec/05_commonvuln_CrossSiteScripting.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_CrossSiteScripting.md diff --git a/exampleSite/content/checklist/webappsec/05_commonvuln_FileUploads.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_FileUploads.md index 131f1ab..131f1ab 100644 --- a/exampleSite/content/checklist/webappsec/05_commonvuln_FileUploads.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_FileUploads.md diff --git a/exampleSite/content/checklist/webappsec/05_commonvuln_PersistenceBackEndsandQuerying.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_PersistenceBackEndsandQuerying.md index 094c937..094c937 100644 --- a/exampleSite/content/checklist/webappsec/05_commonvuln_PersistenceBackEndsandQuerying.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_PersistenceBackEndsandQuerying.md diff --git a/exampleSite/content/checklist/webappsec/05_commonvuln_UseofCryptography.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_UseofCryptography.md index ee42846..ee42846 100644 --- a/exampleSite/content/checklist/webappsec/05_commonvuln_UseofCryptography.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/05_commonvuln_UseofCryptography.md diff --git a/exampleSite/content/checklist/webappsec/06_testing.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/06_testing.md index 56fa333..56fa333 100644 --- a/exampleSite/content/checklist/webappsec/06_testing.md +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-checklist/webappsec/06_testing.md diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-feedback/_index.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-feedback/_index.md new file mode 100644 index 0000000..c34a403 --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-feedback/_index.md @@ -0,0 +1,73 @@ +--- +description: Simple Feedback with success and Error custom pages +hidden: true +hide: +- nextpage +- navs +- breadcrumb + +title: Website Feedback +weight: 9 + +skwad: + mode: "form" + url: "?" +--- + +{{%notice success%}} +This is a demo of a [skwad page]({{%ref "content-and-customization/00-adding-content/page-skwad"%}}) +{{%/notice %}} + +Please fill out this brief feedback form so we can ensure a top quality experience to all of our visitors. + +## You +**Email** +{{<c/text "email*" >}}foo@bar.com{{</c/text >}} + +**Name** +{{<c/text "name*" >}}Foo Bar{{</c/text >}} + +## About your visit +**Is this your first visit to the website?** +{{<c/choices first_visit >}} + * (yes) Yes + * (no) No +{{</c/choices>}} + +**What is the primary reason for your visit to the website?** +{{<c/text "first_visit_reason" multi />}} + +**Were you able to find what you needed?** +{{<c/choices found_needed >}} + * (yes) Yes + * (no) No +{{</c/choices>}} + +{{<c/show `{found_needed} == 'no'`>}} +**đą You did not find what you needed, please tell us what info you were seeking?** +{{<c/text "first_visit_reason" multi />}} +{{</c/show>}} + +## About the website + +**How easy is it to find information on the site?** +{{<c/choices findinformation >}} +* (veryeasy) Very Easy +* (easy) Easy +* (average) Average +* (difficult) Difficult +* (verydifficult) Very Difficult +{{</c/choices>}} + +**What is the likelihood that you will return to the site?** +{{<c/choices willreturn >}} +* (likely) Likely +* (Very Likely) Very Likely +* (Moderately Likely) Moderately Likely +* (Slightly Likely) Slightly Likely +* (Unlikely to Return) Difficult Unlikely to Return +{{</c/choices>}} + + +**Please provide any additional comments or suggestions.** +{{<c/text "comment" multi />}}
\ No newline at end of file diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/_index.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/_index.md new file mode 100644 index 0000000..5875b7d --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/_index.md @@ -0,0 +1,239 @@ +--- +description: Quick test +hidden: true +hide: +- header +- nextpage +- nav +- breadcrumb + +title: VulnĂ©rabilitĂ© NPM +weight: 9 + +skwad: + url: "https://localhost:5555/" + mode: "api" + spaceName: "NPMvuln" +--- + +Bonjour, + +Une vulnĂ©rabilitĂ© prĂ©sente dans les outils de gestion de dĂ©pendance de NodeJS (YARN et NPM) permet Ă +un agent malveillant de prendre le contrĂŽle Ă distance sur la compilation de nos applications. + +* La vulnĂ©rabilitĂ© corrompt les librairies utilisĂ©es sur les projets JavaScript (Angular, VueJS, NodeJS....) +* Les versions impactĂ©es sont les suivantes : + * YARN : 1.21 et antĂ©rieur + * NPM : 6.13.3 et antĂ©rieur + +{{%expand "Cliquez ici pour en savoir plus"%}} +{{%panel color="info" header="ressources externes"%}} +* http:// +* http:// + +Cette vulnĂ©rabilitĂ© a Ă©tĂ© communiquĂ©e aux Ă©quipes sĂ©curitĂ© puis XXX Xxxx. +{{%/panel%}} +{{%/expand%}} + +{{%notice success%}} +La procĂ©dure ci dessous +* vous permet de vĂ©rifier si votre poste de travail est vulnĂ©rable +* permettra Ă l'Ă©quipe de sĂ©curitĂ© opĂ©rationnelle d'ajuster le plan d'action d +de traitement de la vulnĂ©rabilitĂ©. +{{%/notice %}} + +## Vous +**Quel est votre adresse email ?** +{{<c/text "email*" >}}xxxxxxx@xxxx.com{{</c/text >}} + + +## VĂ©rifiez la prĂ©sence de la vulnĂ©rabilitĂ© sur votre poste de travail +Les 2 commandes windows suivantes sont Ă taper dans un invite de commande windows + +{{%expand "Cliquez ici pour savoir comment ouvrir un invite de commande windows (cmd.exe)"%}} +* Appuyer sur les touches Windows+R +* Tapper `CMD`, puis sur la touche [EntrĂ©e]. +* Une fois la console ouverte, tappez les 2 commandes dĂ©crites ci dessous +{{%/expand%}} + +. + +### Tappez `yarn version` dans l'invite de commande windows + +```win +C:\> yarn version +``` +**Quels est le rĂ©sultat de la commande `yarn version` ?** +{{<c/choices yarn_cmd_output >}} + * (notfound) j'ai un message comme " ```Yarn n'est pas reconnu en tant que commande interne.....``` " + * (version) un numĂ©ro de version est affichĂ©, comme " ```yarn version 1.2.3``` " + * (rien) rien du tout, il ne se passe rien +{{</c/choices>}} + +{{<c/show `{yarn_cmd_output} == 'notfound'` >}} +{{%notice success%}} +**đ yarn ne semble pas etre installĂ© sur votre poste de travail, aucun risque !** \ +Continuez Ă suivre la procĂ©dure pour vĂ©rifier le dernier composant : `npm`. +{{%/notice%}} +{{</c/show>}} + +{{<c/show `{yarn_cmd_output} == 'version'` >}} +**Quelle version est affichĂ©e ?** +{{<c/choices yarn_version >}} + * (vulnerable) infĂ©rieur Ă la version `1.21.0`, par example `1.10.154` + * (ok) supĂ©rieur ou exactement la version `1.21.0` + * (unknow) Je ne sais pas dire +{{</c/choices>}} +{{</c/show>}} + +{{<c/show `{yarn_version} == 'unknow'` >}} +**Renseignez ici la version qui vous est affichĂ©e** +{{<c/text "yarn_version_unknow" >}}v1.2.3{{</c/text >}} +{{</c/show>}} + +{{<c/show `{yarn_version} == 'vulnerable'` >}} +{{<c/hidden "warn_yarn_vulnerability" "true">}} +{{</c/show>}} + +{{<c/show `{yarn_version} == 'ok'` >}} +{{%notice success%}} +**đ votre version de yarn ne contient par la vulnĂ©rabilitĂ© !** \ +Continuez Ă suivre la procĂ©dure pour vĂ©rifier le dernier composant : `npm`. +{{%/notice%}} +{{</c/show>}} + +{{<c/show `{yarn_version} == 'unknow' || {yarn_cmd_output} == 'rien'` >}} +{{%notice info%}} +**đą On vous recontacte directement pour vous aider !** \ +Continuez Ă suivre la procĂ©dure pour vĂ©rifier le dernier composant : `npm`. +{{%/notice%}} +{{</c/show>}} +. + +### Tappez `npm version` dans l'invite de commande windows + +```win +C:\> npm version +``` +**Quels est le rĂ©sultat de la commande `npm version` ?** +{{<c/choices npm_cmd_output >}} + * (notfound) j'ai un message comme " ```npm n'est pas reconnu en tant que commande interne.....``` " + * (version) un numĂ©ro de version est affichĂ©, comme " ```npm version 1.2.3``` " + * (rien) rien du tout, il ne se passe rien +{{</c/choices>}} + +{{<c/show `{npm_cmd_output} == 'notfound'` >}} +{{%notice success%}} +**đ npm ne semble pas etre installĂ© sur votre poste de travail, aucun risque !** +{{%/notice%}} +{{</c/show>}} + +{{<c/show `{npm_cmd_output} == 'version'` >}} +**Quelle version est affichĂ©e ?** +{{<c/choices npm_version >}} + * (vulnerable) infĂ©rieur Ă la version `6.13.3`, par example `4.73.3` + * (ok) supĂ©rieur ou exactement la version `6.13.3` + * (unknow) Je ne sais pas dire +{{</c/choices>}} +{{</c/show>}} + + + +{{<c/show `{npm_version} == 'vulnerable'` >}} +{{<c/hidden "warn_npm_vulnerability" "true">}} +{{</c/show>}} + +{{<c/show `{npm_version} == 'ok'` >}} +{{%notice success%}} +**đ votre version de npm ne contient par la vulnĂ©rabilitĂ© !** +{{%/notice%}} +{{</c/show>}} + +{{<c/show `{npm_version} == 'unknow'` >}} +**Renseignez ici la version qui vous est affichĂ©e** +{{<c/text "npm_version_unknow" >}}v1.2.3{{</c/text >}} +{{</c/show>}} + +{{<c/show `{npm_version} == 'unknow' || {npm_cmd_output} == 'rien'` >}} +{{%notice info%}} +**đą On vous recontacte directement pour vous aider !** +{{%/notice%}} +{{</c/show>}} + + +{{<c/show `{npm_cmd_output} == "notfound" || {npm_version} == "ok"` >}} +{{<c/show `{yarn_cmd_output} == "notfound" || {yarn_version} == "ok"` >}} +{{%alert success%}} +**Votre poste de travail ne prĂ©sente pas la vulnĂ©rabilitĂ© recherchĂ©e** - Vous pouvez terminer cette procĂ©dure en utilisant le bouton ci dessous +{{%/alert%}} +{{</c/show>}} +{{</c/show>}} + + +{{<c/show `{npm_cmd_output}!= '' && ({npm_version} == "vulnerable" || {yarn_version} == "vulnerable")` >}} + +{{%alert danger%}} +**Attention - poste de travail vulnĂ©rable** + +Votre poste de travail contient une version vulnĂ©rable d'un ou plusieurs composants nodejs + +Corrigez la vulnĂ©rabilitĂ© en mettant Ă jour nodejs avec une version corrigĂ©e. +Vous trouverez ci dessous la liste des versions mineures minimum de nodeJS contenant la correction. +{{%/alert%}} + + +## Corrigez la vulnĂ©rabilitĂ© + +**Quelle version de nodeJS avez vous ?**\ +_Pour connaitre votre version de node actuelle, tappez `node --version` dans l'invite de commande windows._ +{{<c/choices node_version >}} + * (8) version 8 majeure, exemple `v8.4.23` + * (10) version 10 majeure, exemple `v10.4.23` + * (12) version 12 majeure, exemple `v12.4.23` + * (13) version 13 majeure, exemple `v13.4.23` + * (autre) une autre version +{{</c/choices>}} + +{{<c/show `{node_version} == 'autre'` >}} +**Renseignez ici la version qui vous est affichĂ©e** +{{<c/text "node_node_other" >}}v14.2.3{{</c/text >}} +{{</c/show>}} + +{{<c/show `{node_node_other} != ''` >}} +{{%notice info%}} +**đ On vous recontacte directement pour vous aider !** +{{%/notice%}} +{{</c/show>}} + +{{<c/show `{node_version} != '' && {node_version} != 'autre'` >}} +{{%notice primary%}} +**Mettez Ă jour nodejs** +{{<c/show `{node_version} == '8'` >}} nodejs v8, Ă partir de la version **8.17.0** corrige npm et yarn{{</c/show>}} +{{<c/show `{node_version} == '10'` >}} nodejs v10, Ă partir de la version **10.18.0** corrige npm et yarn{{</c/show>}} +{{<c/show `{node_version} == '12'` >}} nodejs v12, Ă partir de la version **12.14.0** corrige npm et yarn{{</c/show>}} +{{<c/show `{node_version} == '13'` >}} nodejs v13, Ă partir de la version **13.4.0** corrige npm et yarn{{</c/show>}} +{{%/notice%}} + + +**Avez vous mis Ă jour nodeJS dans la version minimale corrigĂ©e ?** +{{<c/choices node_updated >}} + * (yes) C'est fait. + * (no) Je le ferai plus tard. +{{</c/choices>}} +{{</c/show>}} + +{{</c/show>}} + + +{{<c/show `{npm_version} != "" && {yarn_version} != ""` >}} +## Recommandation PRI|SMS - Architecture technique + +{{%alert info%}} +**La version v12.15.0** de nodeJS est la version la plus courante disponible sur les runners d'intĂ©gration continue. +{{%/alert%}} +{{</c/show>}} + + + +## Un commentaire ? (forme et/ou fond) +{{<c/text "comment" multi />}}
\ No newline at end of file diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/confirm.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/confirm.md new file mode 100644 index 0000000..1ff3201 --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/confirm.md @@ -0,0 +1,15 @@ +--- +hidden: true +hide: +- header +- nextpage +- nav +- breadcrumb + +title: Enregistré ! +weight: 99 +hidden: true + +--- + +Thank You !
\ No newline at end of file diff --git a/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/error.md b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/error.md new file mode 100644 index 0000000..8e7215e --- /dev/null +++ b/exampleSite/content/content-and-customization/00-adding-content/page-skwad/ex-npm/error.md @@ -0,0 +1,15 @@ +--- +hidden: true +hide: +- header +- nextpage +- nav +- breadcrumb + +title: Erreur ! +weight: 99 +hidden: true + +--- + +Aie !fsd
\ No newline at end of file diff --git a/exampleSite/resources/_gen/assets/scss/sass/checklist.scss_830e2c6732622c34cf9ed8a208896bac.content b/exampleSite/resources/_gen/assets/scss/sass/checklist.scss_830e2c6732622c34cf9ed8a208896bac.content index 3e1b0f4..eeabafd 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/checklist.scss_830e2c6732622c34cf9ed8a208896bac.content +++ b/exampleSite/resources/_gen/assets/scss/sass/checklist.scss_830e2c6732622c34cf9ed8a208896bac.content @@ -27,13 +27,26 @@ body article section.page div.content div.checklist-header .form-control-file { border-style: solid; box-shadow: inset 0px 0px 0px 0.25em currentColor; } +body article section.page div.content h2 a { + margin-left: 0.2em; + text-decoration: none; } + body article section.page div.content div.checklist-footer { margin-top: 2em; margin-bottom: 2em; text-align: center; } body #TableOfContents > ul li input { - margin-right: 0.3em; } + margin-right: 0.3em; + display: none; } + +body #TableOfContents > ul li i { + margin-right: 0.3em; + color: #e6e6e6; } + body #TableOfContents > ul li i.fa-check-circle { + color: green; } + body #TableOfContents > ul li i.fa-dot-circle { + color: #999999; } body #TableOfContents > ul li:not(.cl-ready):not(.cl-done):not(.cl-doing) input { visibility: hidden; } diff --git a/exampleSite/resources/_gen/assets/scss/sass/main.scss_97a9b8e6852415b29a37632934745b8b.content b/exampleSite/resources/_gen/assets/scss/sass/main.scss_97a9b8e6852415b29a37632934745b8b.content index 2c9e14c..ff458cb 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/main.scss_97a9b8e6852415b29a37632934745b8b.content +++ b/exampleSite/resources/_gen/assets/scss/sass/main.scss_97a9b8e6852415b29a37632934745b8b.content @@ -18,7 +18,7 @@ body { justify-content: space-between; align-items: stretch; color: #e6e6e6; } - body header a { + body header a, body header a:hover { color: #cccccc; } body header > div { display: flex; @@ -87,11 +87,12 @@ body { list-style-type: none; } body article section.right-menu > div li { padding: 8px 0px 8px 0px; - font-weight: 300; } + font-weight: 300; + border-bottom: 1px solid transparent; } + body article section.right-menu > div li.active { + border-bottom: 1px dashed #999999; } body article section.right-menu > div li a { /*padding-left: 2px;*/ } - body article section.right-menu > div li a.active { - font-weight: 500; } body article section.right-menu .Actions { font-size: 75%; } body footer { @@ -306,11 +307,13 @@ article section.page div.content { overflow: inherit !important; } article section.page div.content div.highlight pre code { color: inherit !important; - font-size: 75%; + font-size: 95%; display: block; - margin-left: -1.5rem; - margin-right: -1.5rem; + line-height: 1.2em; padding: 10px; border: 0px; font-weight: inherit; background-color: inherit; } + article section.page div.content > div.highlight pre code { + margin-left: -1.5rem; + margin-right: -1.5rem; } diff --git a/exampleSite/resources/_gen/assets/scss/sass/shortcodes/notice.scss_f300667da4f5b5f84e1a9e0702b2fdde.content b/exampleSite/resources/_gen/assets/scss/sass/shortcodes/notice.scss_f300667da4f5b5f84e1a9e0702b2fdde.content index 85c8783..c818bbb 100644 --- a/exampleSite/resources/_gen/assets/scss/sass/shortcodes/notice.scss_f300667da4f5b5f84e1a9e0702b2fdde.content +++ b/exampleSite/resources/_gen/assets/scss/sass/shortcodes/notice.scss_f300667da4f5b5f84e1a9e0702b2fdde.content @@ -13,7 +13,7 @@ div.notices { /*box-shadow: inset 4px 0 0 black;*/ /*border-radius: .2rem;*/ padding: .5rem 1rem .5rem 1rem; } - div.notices label { + div.notices > label { font-size: 0.5em; position: absolute; margin-left: 0em; @@ -27,7 +27,7 @@ div.notices { color: #004a99 !important; } div.notices.note label { color: #007bff; } - div.notices.primary p { + div.notices.primary > *:not(label) { box-shadow: inset 4px 0 0 #007bff; background: rgba(0, 123, 255, 0.05); color: #004a99 !important; } @@ -39,49 +39,49 @@ div.notices { color: #3d4246 !important; } div.notices.secondary label { color: #6c757d; } - div.notices.success p, div.notices.tip p { + div.notices.success > *:not(label), div.notices.tip > *:not(label) { box-shadow: inset 4px 0 0 #28a745; background: rgba(40, 167, 69, 0.05); color: #145523 !important; } div.notices.success label, div.notices.tip label { color: #28a745; } - div.notices.danger p { + div.notices.danger > *:not(label) { box-shadow: inset 4px 0 0 #dc3545; background: rgba(220, 53, 69, 0.05); color: #921925 !important; } div.notices.danger label { color: #dc3545; } - div.notices.warning > * { + div.notices.warning > *:not(label) { box-shadow: inset 4px 0 0 #ffc107; background: rgba(255, 193, 7, 0.05); color: #a07800 !important; } div.notices.warning label { color: #ffc107; } - div.notices.info p { + div.notices.info > *:not(label) { box-shadow: inset 4px 0 0 #17a2b8; background: rgba(23, 162, 184, 0.05); color: #0c525d !important; } div.notices.info label { color: #17a2b8; } - div.notices.light p { + div.notices.light > *:not(label) { box-shadow: inset 4px 0 0 #f8f9fa; background: rgba(248, 249, 250, 0.05); color: #bdc6d0 !important; } div.notices.light label { color: #f8f9fa; } - div.notices.dark p { + div.notices.dark > *:not(label) { box-shadow: inset 4px 0 0 #343a40; background: rgba(52, 58, 64, 0.05); color: #060708 !important; } div.notices.dark label { color: #343a40; } - div.notices.white p { + div.notices.white > *:not(label) { box-shadow: inset 4px 0 0 #fff; background: rgba(255, 255, 255, 0.05); color: whiteen(#fff, 20%) !important; } div.notices.white label { color: #fff; } - div.notices.transparent p { + div.notices.transparent > *:not(label) { box-shadow: inset 4px 0 0 transparent; background: rgba(0, 0, 0, 0); color: transparenten(transparent, 20%) !important; } diff --git a/i18n/en.toml b/i18n/en.toml index b527071..37038eb 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -60,4 +60,4 @@ other = "Load answers from file" other = "Download Answers" [checklist-post-answers] -other = "Post Answers"
\ No newline at end of file +other = "Submit Answers" diff --git a/i18n/fr.toml b/i18n/fr.toml index c37a8f4..d33a516 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -60,4 +60,5 @@ other = "Charger un fichier de réponse" other = "Télécharger les réponses" [checklist-post-answers] -other = "Envoyer les réponses"
\ No newline at end of file +other = "Envoyer les réponses" + diff --git a/layouts/partials/_checklist-footer.html b/layouts/partials/_checklist-footer.html deleted file mode 100644 index 009e6fc..0000000 --- a/layouts/partials/_checklist-footer.html +++ /dev/null @@ -1,8 +0,0 @@ -{{if .Params.checklist}} - </form> - <div class="checklist-footer"> - <button type="button" - onclick="downloadFile('6d2ab01b-fad4-4e70-83a8-b910ca848fec');" - class="btn btn-success"><i class="fas fa-download"></i> {{T "checklist-download-answers"}}</button> - </div> -{{end}} diff --git a/layouts/partials/_checklist-header.html b/layouts/partials/_checklist-header.html deleted file mode 100644 index 4426680..0000000 --- a/layouts/partials/_checklist-header.html +++ /dev/null @@ -1,16 +0,0 @@ -{{if .Params.checklist}} - {{ $formID := .File.UniqueID }} - <link rel="stylesheet" href='{{ (resources.Get "sass/checklist.scss" | resources.ExecuteAsTemplate "css/checklist.main.scss" . | toCSS).Permalink }}'> - <form name="{{$formID}}" id="6d2ab01b-fad4-4e70-83a8-b910ca848fec" ref="{{with $.Params.Ref}}{{.}}{{else}}{{printf "%s-%s" $.CurrentSection.Title $formID}}{{end}}"> - <script src='{{"js/checklist.js" | relURL}}'></script> - <script type="text/javascript"> - $( document ).ready(function() { - listenFormChange('6d2ab01b-fad4-4e70-83a8-b910ca848fec') - }); - </script> - - <div class="form-group checklist-header"> - <label class="sr-only" for="inputFile">File Upload</label> - <input type="file" class="form-control-file text-primary font-weight-bold" id="inputFile" accept="application/json" onchange="onChooseFile(event,fillForm('6d2ab01b-fad4-4e70-83a8-b910ca848fec'))" data-title="{{T "checklist-load-answers"}}"> - </div> -{{end}}
\ No newline at end of file diff --git a/layouts/partials/_menu.html b/layouts/partials/_menu.html index 658274e..148bb6d 100644 --- a/layouts/partials/_menu.html +++ b/layouts/partials/_menu.html @@ -20,8 +20,7 @@ {{if lt $level $maxlevel }} {{- with .sect}} {{- if and .IsSection (or (not .Params.hidden) $.showhidden)}} - {{- $numberOfPages := (len .Sections) }} - {{- $numberOfPages := (len (where .Sections "Params.subpage" "ne" true)) }} + {{- $numberOfPages := (len (where (where .Sections "Params.subpage" "ne" true) "Params.hidden" "ne" true )) }} {{- safeHTML .Params.head}} <li data-nav-id="{{.Permalink}}" class="dd-item {{- if .IsAncestor $currentNode}} parent{{end}} @@ -37,7 +36,6 @@ {{if gt $level 0 }} <a href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{$menuTitle}}{{safeHTML .Params.Post}}</a> {{end}} - {{- if and (ne $numberOfPages 0) (lt (add $level 1) $maxlevel) }} {{- if or (.IsAncestor $currentNode) (.Params.alwaysopen) }} <i class="fas fa-chevron-down ddexp"></i> diff --git a/layouts/partials/_skwad-footer.html b/layouts/partials/_skwad-footer.html new file mode 100644 index 0000000..da9c5bd --- /dev/null +++ b/layouts/partials/_skwad-footer.html @@ -0,0 +1,21 @@ +{{if .Params.skwad}} + <span></span> + + {{if ne nil .Params.skwad.mode }} + <div class="checklist-footer"> + <button type="submit" class="btn btn-primary">{{T "checklist-post-answers"}}</button> + <p> </p> + </div> + {{end}} + + </form> + {{if eq true .Params.skwad.clientside}} + {{if .Params.skwad.url }} + <div class="checklist-footer"> + <button type="button" + onclick="skwad.saveDocumentAsFile(skwad.form.getAttribute('ref'));" + class="btn btn-success"><i class="fas fa-download"></i> {{T "checklist-download-answers"}}</button> + </div> + {{end}} + {{end}} +{{end}}
\ No newline at end of file diff --git a/layouts/partials/_skwad-header.html b/layouts/partials/_skwad-header.html new file mode 100644 index 0000000..b0d2877 --- /dev/null +++ b/layouts/partials/_skwad-header.html @@ -0,0 +1,181 @@ +{{if .Params.skwad}} + {{ $formID := .File.UniqueID }} + <link rel="stylesheet" href='{{ (resources.Get "sass/checklist.scss" | resources.ExecuteAsTemplate "css/checklist.main.scss" . | toCSS).Permalink }}'> + + {{if .Params.skwad.url }} + <script src="{{.Params.skwad.url }}x/skwad.js"></script> + <script type="text/javascript"> + skwad_api_url = "/"; + skawd_form_id = ""; + + $(document).ready(function () { + skwad.InitWithConfig({ + formID: "{{$formID}}", // default is the first form + {{if eq "api" .Params.skwad.mode }} + {{with .Params.skwad.url}}url: "{{.}}",{{end}} + {{with .Params.skwad.spaceName}}spaceName: "{{.}}", {{end}} // default null, use form attribute action when not set + {{end}} + // networkIndicatorID: "skwad_spinner", // loader HTLML DOM ID + // documentKey: "forms/test", // when set, skwad.UseDocument('forms/flksdjml') + // documentKeyInParam: "_k", // when set, skwad.UseDocumentWithURLParam('_k') + // onSaveError: skwad.redirectTo("error.html"), // Trigger this func on Error + // onSaveSuccess: skwad.redirectTo("confirm.html"), // Trigger this func on Success + onUseDocumentError: function (err) { + console.log("Document not found ! error is : " + err.message); + }, + //beforeFormSubmit:function(e,s){alert("before",e,s);e.preventDefault();return false}, + //formChangeHooks: [YourFunc], + }); + + function YourFunc(progress, form) { + // Remove all from ul + // console.debug(progress) + $("#TableOfContents > ul li").remove(); + let inputs; + for (const section in progress) { + inputs = progress[section].inputs; + const pct = Math.round( + (progress[section].status.valued / + progress[section].status.count) * + 100 + ); + const li = $("<li/>").attr("progres", pct).appendTo($("#TableOfContents > ul")); + // if (!isNaN(pct)) { + // const chk = $( + // '<input type="checkbox" disabled="" readonly="">' + // ).appendTo(li); + // if (pct === 100) { + // chk.prop("checked", true); + // li.addClass('cl-done'); + // } else if (pct > 0) { + // chk.prop("indeterminate", true); + // li.addClass('cl-doing'); + // } else { + // chk.prop("checked", false); + // li.addClass('cl-ready'); + // } + // } + + + + if (!isNaN(pct)) { + const chk = $( + '<i class="fas">' + ).appendTo(li); + if (pct === 100) { + chk.addClass('fa-check-circle'); + } else if (pct > 0) { + chk.addClass('fa-dot-circle'); + } else { + chk.prop("checked", false); + chk.addClass('fa-circle-notch'); + } + } + + // <i class="fas fa-check-circle"></i> + // <i class="fas fa-dot-circle"></i> + // <i class="fas fa-exclamation-circle"></i> + // <i class="fas fa-circle-notch"></i> + + + $("<a/>") + .attr("id", "toc-" + progress[section].id) + .attr("href", "#" + progress[section].ref) + .text(progress[section].title) + .appendTo(li); + } + } + skwad.HookOnFormChange(YourFunc); + + (function scrollSpy() { + var OFFSET = 10; + var timer; + var headingsCache; + + var findHeadings = function findHeadings() { + // return headingsCache || document.querySelectorAll('.TableOfContents li > a'); + return document.querySelectorAll('.TableOfContents li > a'); + }; + + var onScroll = function onScroll() { + if (timer) { + // throttle + return; + } + + timer = setTimeout(function() { + timer = null; + var activeNavFound = false; + var headings = findHeadings(); // toc nav anchors + + /** + * On every call, try to find header right after <-- next header + * the one whose content is on the current screen <-- highlight this + */ + + for (var i = 0; i < headings.length; i++) { + // headings[i] is current element + // if an element is already active, then current element is not active + // if no element is already active, then current element is active + var currNavActive = !activeNavFound; + /** + * Enter the following check up only when an active nav header is not yet found + * Then, check the bounding rectangle of the next header + * The headers that are scrolled passed will have negative bounding rect top + * So the first one with positive bounding rect top will be the nearest next header + */ + + if (currNavActive && i < headings.length - 1) { + var heading = headings[i + 1]; + var next = decodeURIComponent(heading.href.split('#')[1]); + var nextHeader = document.getElementById(next); + + if (nextHeader) { + var top = nextHeader.getBoundingClientRect().top; + currNavActive = top > OFFSET; + } else { + console.error('Can not find header element', { + id: next, + heading: heading, + }); + } + } + /** + * Stop searching once a first such header is found, + * this makes sure the highlighted header is the most current one + */ + + if (currNavActive) { + activeNavFound = true; + headings[i].parentElement.classList.add('active'); + } else { + headings[i].parentElement.classList.remove('active'); + } + } + }, 100); + }; + + document.addEventListener('scroll', onScroll); + document.addEventListener('resize', onScroll); + // document.addEventListener('DOMContentLoaded', function() { + // // Cache the headings once the page has fully loaded. + // headingsCache = findHeadings(); + // onScroll(); + // }); + })(); + }); + </script> + {{end}} + <form + method="POST" {{if eq "form" .Params.skwad.mode}}action="{{.Params.skwad.url}}"{{end}} + id="{{$formID}}" ref="{{with $.Params.Ref}}{{.}}{{else}}{{printf "%s-%s" $.CurrentSection.Title $formID}}{{end}}"> + + + {{if eq true .Params.skwad.clientside}} + <div class="form-group checklist-header"> + <label class="sr-only" for="inputFile">File Upload</label> + <input type="file" class="form-control-file text-primary font-weight-bold" id="inputFile" accept="application/json" + onchange="skwad.UseDocumentWithFile(this)" data-title="{{T "checklist-load-answers"}}"> + </div> + {{end}} +{{end}}
\ No newline at end of file diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html index 73f2abf..93e1dfb 100644 --- a/layouts/partials/body-article-content.html +++ b/layouts/partials/body-article-content.html @@ -75,9 +75,9 @@ <div class="content">
{{- with .Content -}}
- {{ partial "_checklist-header.html" $ }}
+ {{ partial "_skwad-header.html" $ }}
{{ . | replaceRE "(<h[1-9]) id=\"([^\"]+)\"(.+)(</h[1-9]+>)" `${1} ref="${2}" ${3}${4}<a class="anchor" id="${2}"></a>` | safeHTML }}
- {{ partial "_checklist-footer.html" $ }}
+ {{ partial "_skwad-footer.html" $ }}
{{- else -}}
{{with index .Pages 0}}
<meta http-equiv = "refresh" content = "0; url = {{.RelPermalink}}"/>
diff --git a/layouts/shortcodes/c/show.html b/layouts/shortcodes/c/show.html index 830c784..8f854bd 100644 --- a/layouts/shortcodes/c/show.html +++ b/layouts/shortcodes/c/show.html @@ -1,13 +1,13 @@ {{ $random := delimit (shuffle (split (md5 .Page.File.UniqueID) "" )) "" }} {{ $id := printf "dp-show-%s" $random}} {{ $condition := trim (.Get 0) " "}} -{{ $regFormValue := printf "formValue('$1')"}} +{{ $regFormValue := printf "skwad.fValue('$1')"}} {{ $conditionFix := replaceRE `{(\w+)}` $regFormValue $condition }} {{ $conditionFix = replace $conditionFix ` and ` ` && ` }} {{ $conditionFix = replace $conditionFix ` or ` ` || ` }} {{ $conditionFix = replaceRE `[^)]+has\s+('\w+')` ".includes($1)" $conditionFix }} -<div id="{{$id}}" class="baz" style="display:none" cond="{{$conditionFix | safeHTMLAttr}}"> +<div id="{{$id}}" class="baz" style="display:none" v-if="{{$conditionFix | safeHTMLAttr}}"> {{with .Get 1}} <input type="hidden" value="true" name="{{.}}"> {{end}} diff --git a/static/js/docport.js b/static/js/docport.js index 50afce0..d328e85 100644 --- a/static/js/docport.js +++ b/static/js/docport.js @@ -8,7 +8,7 @@ jQuery(document).ready(function() { });
// Execute actions on images generated from Markdown pages
-
+
var images = $("article section.page img");
// Change styles, depending on parameters set to the image
images.each(function (index) {
@@ -101,9 +101,9 @@ jQuery(document).ready(function() { if (currNavActive) {
activeNavFound = true;
- headings[i].classList.add('active');
+ headings[i].parentElement.classList.add('active');
} else {
- headings[i].classList.remove('active');
+ headings[i].parentElement.classList.remove('active');
}
}
}, 100);
|