Merge branch ‘develop’ #10

Merged
6543 merged 19 commits from develop into master 2019-07-14 01:29:25 +00:00
1 changed files with 22 additions and 4 deletions
Showing only changes of commit 6c9a2fe2e0 - Show all commits

View File

@ -1,8 +1,26 @@
{{ $mode := .Get 0 }}
{{ $mode := .Get 0 }}{{ $opt := .Get 1 }}

{{ $img_on := ( printf "%s%s" $.Page.Site.BaseURL "img/on-off/switch-on-icon_smal.png" )}}
{{ $img_off := ( printf "%s%s" $.Page.Site.BaseURL "img/on-off/switch-off-icon_smal.png" )}}

{{ if eq $mode "on" }}
<img src="{{ .Page.Site.BaseURL }}img/on-off/switch-on-icon_smal.png" alt="On">
<img src="{{ $img_on }}" alt="On">
{{ else if eq $mode "off"}}
<img src="{{ .Page.Site.BaseURL }}img/on-off/switch-off-icon_smal.png" alt="Off">
<img src="{{ $img_off }}" alt="Off">
{{ else if eq $mode "imgping" }}
{{ with $opt }}
{{ $id := md5 $opt }}
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
<script language="JavaScript">
var imgping = new Image();
imgping.src = '{{ $opt }}';
if(imgping.height>0){
document.getElementById("{{ $id }}").outerHTML ='<img src="{{ $img_on }}" alt="On">';
}
</script>
{{ else }}
Ned URL to image
{{ end }}
{{ else }}
???
{{end}}
{{ end }}