Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/c/show.html')
-rw-r--r--layouts/shortcodes/c/show.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/layouts/shortcodes/c/show.html b/layouts/shortcodes/c/show.html
new file mode 100644
index 0000000..8eda479
--- /dev/null
+++ b/layouts/shortcodes/c/show.html
@@ -0,0 +1,12 @@
+{{ $formID := "6d2ab01b-fad4-4e70-83a8-b910ca848fec" }}
+{{ $random := delimit (shuffle (split (md5 $formID) "" )) "" }}
+{{ $id := printf "dp-show-%s" $random}}
+{{ $condition := trim (.Get 0) " "}}
+{{ $regFormValue := printf "formValue('%s','$1')" $formID}}
+{{ $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">{{.Inner | markdownify}}</div>
+<script type="text/javascript">$(registerShowIf('{{$id}}','{{$conditionFix}}'))</script>