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

show.html « c « shortcodes « layouts - github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 637f4304ef895e8f2c5c168c92eab1ebdabe6e90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $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">
{{with .Get 1}}
<input type="hidden" value="true" name="{{.}}">
{{end}}
{{.Inner | markdownify}}</div>
<script type="text/javascript">$(registerShowIf('{{$id}}','{{$conditionFix}}'))</script>