all repos — honk @ fcc26c183da6f7be9f2baa1016ad56f3c8438773

my fork of honk

jazz up honkerlinks, remove classes
Ted Unangst tedu@tedunangst.com
Tue, 01 Oct 2019 19:45:17 -0400
commit

fcc26c183da6f7be9f2baa1016ad56f3c8438773

parent

2d8b2b0737d38e7e5a19a0c597642082e2ac8d1c

3 files changed, 22 insertions(+), 6 deletions(-)

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

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

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

@@ -17,7 +17,7 @@ {{ if .Oonker }}

<br> <span style="margin-left: 1em;" class="clip"> {{ if $bonkcsrf }} -original: <a href="/h?xid={{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a> +original: <a class="honkerlink" href="/h?xid={{ .Oonker }}">{{ .Oondle }}</a> {{ else }} original: <a href="{{ .Oonker }}" rel=noreferrer>{{ .Oondle }}</a> {{ end }}
M views/honkpage.jsviews/honkpage.js

@@ -86,6 +86,9 @@ args["c"] = arg

} else if (name == "combo") { console.log("loading combo " + arg) args["c"] = arg + } else if (name == "honker") { + console.log("loading honker " + arg) + args["xid"] = arg } else { var stash = name + ":" + arg args["topxid"] = topxid[stash]

@@ -156,12 +159,19 @@ }

} function relinklinks() { var els = document.getElementsByClassName("convoylink") - for (var i = 0; i < els.length; i++) { - els[i].onclick = pageswitcher("convoy", els[i].text) + while (els.length) { + els[0].onclick = pageswitcher("convoy", els[0].text) + els[0].classList.remove("convoylink") } els = document.getElementsByClassName("combolink") - for (var i = 0; i < els.length; i++) { - els[i].onclick = pageswitcher("combo", els[i].text) + while (els.length) { + els[0].onclick = pageswitcher("combo", els[0].text) + 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") } } (function() {
M web.goweb.go

@@ -1450,6 +1450,12 @@ honks = gethonksbycombo(userid, c)

case "convoy": c := r.FormValue("c") honks = gethonksbyconvoy(userid, c) + case "honker": + xid := r.FormValue("xid") + if strings.IndexByte(xid, '@') != -1 { + xid = gofish(xid) + } + honks = gethonksbyxonker(userid, xid) default: http.NotFound(w, r) }