diff --git a/views/honkpage.html b/views/honkpage.html index a04cd36..6823144 100644 --- a/views/honkpage.html +++ b/views/honkpage.html @@ -1,17 +1,5 @@ {{ template "header.html" . }}
-{{ if .HonkCSRF }} - - -{{ end }}
{{ if .Name }} @@ -22,6 +10,16 @@ servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
{{ if .HonkCSRF }} {{ template "honkform.html" . }} + + {{ end }}
{{ if and .HonkCSRF (not .IsPreview) }} diff --git a/views/honkpage.js b/views/honkpage.js index 36d2158..cbd25c2 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -243,8 +243,7 @@ function relinklinks() { history.replaceState(curpagestate, "some title", "") })(); (function() { - var el = document.getElementById("donkdescriptor") - el.style.display = "none" + hideelement("donkdescriptor") })(); function showhonkform(elem, rid, hname) { var form = lehonkform @@ -278,11 +277,13 @@ function cancelhonking() { function showelement(el) { if (typeof(el) == "string") el = document.getElementById(el) + if (!el) return el.style.display = "block" } function hideelement(el) { if (typeof(el) == "string") el = document.getElementById(el) + if (!el) return el.style.display = "none" } function updatedonker() {