all repos — honk @ 48ac9639a4f9d65bd227055f14b54fbf938b5fe6

my fork of honk

fix js errors
Ted Unangst tedu@tedunangst.com
Tue, 25 Feb 2020 13:45:59 -0500
commit

48ac9639a4f9d65bd227055f14b54fbf938b5fe6

parent

14e01ff130deb6f65f277c5bb415d28a7692ed30

2 files changed, 12 insertions(+), 13 deletions(-)

jump to
M views/honkpage.htmlviews/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.jsviews/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() {