fix js errors
Ted Unangst tedu@tedunangst.com
Tue, 25 Feb 2020 13:45:59 -0500
2 files changed,
12 insertions(+),
13 deletions(-)
M
views/honkpage.html
→
views/honkpage.html
@@ -1,6 +1,15 @@
{{ template "header.html" . }} <main> +<div class="info" id="infobox"> +<div id="srvmsg"> +{{ if .Name }} +<p>{{ .Name }} <span style="margin-left:1em;"><a href="/u/{{ .Name }}/rss">rss</a></span> +<p>{{ .WhatAbout }} +{{ end }} +<p>{{ .ServerMessage }} +</div> {{ if .HonkCSRF }} +{{ template "honkform.html" . }} <script> var csrftoken = {{ .HonkCSRF }} var honksforpage = { }@@ -11,17 +20,6 @@ var servermsgs = { }
servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}" </script> <script src="/honkpage.js{{ .JSParam }}"></script> -{{ end }} -<div class="info" id="infobox"> -<div id="srvmsg"> -{{ if .Name }} -<p>{{ .Name }} <span style="margin-left:1em;"><a href="/u/{{ .Name }}/rss">rss</a></span> -<p>{{ .WhatAbout }} -{{ end }} -<p>{{ .ServerMessage }} -</div> -{{ if .HonkCSRF }} -{{ template "honkform.html" . }} {{ end }} </div> {{ if and .HonkCSRF (not .IsPreview) }}
M
views/honkpage.js
→
views/honkpage.js
@@ -243,8 +243,7 @@ window.onpopstate = statechanger
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 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() {