fix js errors
This commit is contained in:
parent
cd7537c110
commit
64b710019e
|
@ -1,17 +1,5 @@
|
|||
{{ 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 }}
|
||||
|
@ -22,6 +10,16 @@ servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
|
|||
</div>
|
||||
{{ if .HonkCSRF }}
|
||||
{{ template "honkform.html" . }}
|
||||
<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>
|
||||
{{ if and .HonkCSRF (not .IsPreview) }}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue