fix: Same id

This commit is contained in:
Simon 2020-03-09 16:22:01 +01:00
parent 1e4735234c
commit ff2bb7e09b
1 changed files with 2 additions and 2 deletions

View File

@ -12,13 +12,13 @@
{{- $fingerprint := md5 (print (.Get "address") $protocol (index (seq 999 | shuffle) 0)) | truncate 8 "" -}}
{{/* Set via CSS what is displayed when Javascript is disabled. Query is never displayed */}}
<style type="text/css">
#id-{{ $fingerprint }}.cloaked-e-mail:before {
#wjs-{{ $fingerprint }}.cloaked-e-mail:before {
content:{{ with $domain }}attr(data-domain) "\0040" {{ end }}attr(data-user);
unicode-bidi:bidi-override;
direction:rtl;
}
</style>
&#32;<span class="cloaked-e-mail" data-user="{{ range $index := seq (sub (len $user) 1) 0}}{{ substr $user $index 1}}{{ end }}"{{ with $domain }} data-domain="{{ range $index := seq (sub (len $domain) 1) 0}}{{ substr $domain $index 1}}{{ end }}"{{ end }} id="id-{{ $fingerprint }}"></span>&#32;
&#32;<span class="cloaked-e-mail" data-user="{{ range $index := seq (sub (len $user) 1) 0}}{{ substr $user $index 1}}{{ end }}"{{ with $domain }} data-domain="{{ range $index := seq (sub (len $domain) 1) 0}}{{ substr $domain $index 1}}{{ end }}"{{ end }} id="wjs-{{ $fingerprint }}"></span>&#32;
{{/* Alter display with Javascript by changing DOM */}}
<script id="id-{{ $fingerprint }}">
var scriptTag = document.getElementById("id-{{ $fingerprint }}");