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