all repos — honk @ eb8a5ac5408008667e5ee0d471d1aff6a63004c7

my fork of honk

can't use shortened form for honker links
Ted Unangst tedu@tedunangst.com
Fri, 04 Oct 2019 02:32:44 -0400
commit

eb8a5ac5408008667e5ee0d471d1aff6a63004c7

parent

e54ece42b54344f4770eb41c7a8ff101477ccc69

2 files changed, 5 insertions(+), 3 deletions(-)

jump to
M views/honk.htmlviews/honk.html

@@ -8,7 +8,7 @@ <img alt="" src="/a?a={{ .Oonker}}">

{{ 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 }}
M views/honkpage.jsviews/honkpage.js

@@ -167,8 +167,10 @@ els[0].classList.remove("combolink")

} 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() {