all repos — honk @ f15ec859bf4470f0e2ffd702f7fc7cb12ff4c73e

my fork of honk

cleanup javascript a touch
Ted Unangst tedu@tedunangst.com
Mon, 19 Aug 2019 03:21:53 -0400
commit

f15ec859bf4470f0e2ffd702f7fc7cb12ff4c73e

parent

dabfdf4ee1de720202b200299ad848fffb6891e1

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

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

@@ -14,13 +14,12 @@ {{ $BonkCSRF := .HonkCSRF }}

{{ if .TopXID }} <div class="info" id="refreshbox"> <script> -var topxid = {{ .TopXID }} +var topxid = "{{ .TopXID }}" function refreshhonks() { get("/?topxid=" + escape(topxid), function(xhr) { var doc = xhr.responseXML - topel = doc.children[0].children[1].children[0] - topxid = topel.innerText - honks = doc.children[0].children[1].children + topxid = doc.children[0].children[1].children[0].innerText + var honks = doc.children[0].children[1].children var mebox = document.getElementById("refreshbox") for (var i = honks.length; i > 1; i--) { mebox.insertAdjacentElement('afterend', honks[i-1])

@@ -30,7 +29,6 @@ }

</script> <p><button onclick="refreshhonks()">refresh</button> </div> - {{ end }} {{ range .Honks }} {{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF }}