move scripting up so it's available on partially loaded pages

This commit is contained in:
Ted Unangst 2020-01-29 21:06:47 -05:00
parent 942025be9b
commit 921524a42a
1 changed files with 11 additions and 11 deletions

View File

@ -18,17 +18,6 @@
<button onclick="oldestnewest(this)">scroll down</button>
</div>
{{ end }}
<div id="honksonpage">
<div>
{{ $BonkCSRF := .HonkCSRF }}
{{ $IsPreview := .IsPreview }}
{{ $MapLink := .MapLink }}
{{ range .Honks }}
{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview }}
{{ end }}
</div>
</div>
</main>
{{ if .HonkCSRF }}
<script>
var csrftoken = {{ .HonkCSRF }}
@ -42,3 +31,14 @@ servermsgs[curpagestate.name + ":" + curpagestate.arg] = "{{ .ServerMessage }}"
</script>
<script src="/honkpage.js{{ .JSParam }}"></script>
{{ end }}
<div id="honksonpage">
<div>
{{ $BonkCSRF := .HonkCSRF }}
{{ $IsPreview := .IsPreview }}
{{ $MapLink := .MapLink }}
{{ range .Honks }}
{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview }}
{{ end }}
</div>
</div>
</main>