gross hack to hide refresh when it won't work

This commit is contained in:
Ted Unangst 2020-02-21 09:54:25 -05:00
parent b949478f50
commit 6f40c81597
2 changed files with 14 additions and 13 deletions

View File

@ -1,5 +1,17 @@
{{ template "header.html" . }} {{ template "header.html" . }}
<main> <main>
{{ if .HonkCSRF }}
<script>
var csrftoken = {{ .HonkCSRF }}
var honksforpage = { }
var curpagestate = { name: "{{ .PageName }}", arg : "{{ .PageArg }}" }
var tophid = { }
tophid[curpagestate.name + ":" + curpagestate.arg] = "{{ .TopHID }}"
var servermsgs = { }
servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
</script>
<script src="/honkpage.js{{ .JSParam }}"></script>
{{ end }}
<div class="info" id="infobox"> <div class="info" id="infobox">
<div id="srvmsg"> <div id="srvmsg">
{{ if .Name }} {{ if .Name }}
@ -17,19 +29,7 @@
<p><button onclick="refreshhonks(this)">refresh</button><span></span> <p><button onclick="refreshhonks(this)">refresh</button><span></span>
<button onclick="oldestnewest(this)">scroll down</button> <button onclick="oldestnewest(this)">scroll down</button>
</div> </div>
{{ end }} {{ if eq .ServerMessage "one honk maybe more" }} <script> hideelement("refreshbox")</script> {{ end }}
{{ if .HonkCSRF }}
<script>
var csrftoken = {{ .HonkCSRF }}
var honksforpage = { }
var curpagestate = { name: "{{ .PageName }}", arg : "{{ .PageArg }}" }
var tophid = { }
tophid[curpagestate.name + ":" + curpagestate.arg] = "{{ .TopHID }}"
var servermsgs = { }
servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
</script>
<script src="/honkpage.js{{ .JSParam }}"></script>
{{ end }} {{ end }}
<div id="honksonpage"> <div id="honksonpage">
<div> <div>

View File

@ -167,6 +167,7 @@ function switchtopage(name, arg) {
msg.remove() msg.remove()
servermsgs[stash] = msg servermsgs[stash] = msg
} }
showelement("refreshbox")
honksforpage[stash] = holder honksforpage[stash] = holder