can't use shortened form for honker links

This commit is contained in:
Ted Unangst 2019-10-04 02:32:44 -04:00
parent 015dc80499
commit 191406b486
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@
{{ end }} {{ end }}
<p> <p>
{{ if $bonkcsrf }} {{ if $bonkcsrf }}
<a class="honkerlink" href="/h?xid={{ .Honker }}">{{ .Username }}</a> <a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
{{ else }} {{ else }}
<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a> <a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
{{ end }} {{ end }}

View File

@ -167,8 +167,10 @@ function relinklinks() {
} }
els = document.getElementsByClassName("honkerlink") els = document.getElementsByClassName("honkerlink")
while (els.length) { while (els.length) {
els[0].onclick = pageswitcher("honker", els[0].text) var el = els[0]
els[0].classList.remove("honkerlink") var xid = el.getAttribute("data-xid")
el.onclick = pageswitcher("honker", xid)
el.classList.remove("honkerlink")
} }
} }
(function() { (function() {