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" . }}
<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 id="srvmsg">
{{ if .Name }}
@ -17,19 +29,7 @@
<p><button onclick="refreshhonks(this)">refresh</button><span></span>
<button onclick="oldestnewest(this)">scroll down</button>
</div>
{{ 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>
{{ if eq .ServerMessage "one honk maybe more" }} <script> hideelement("refreshbox")</script> {{ end }}
{{ end }}
<div id="honksonpage">
<div>

View File

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