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 }}
<p>
{{ if $bonkcsrf }}
<a class="honkerlink" href="/h?xid={{ .Honker }}">{{ .Username }}</a>
<a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>
{{ else }}
<a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a>
{{ end }}

View File

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