record starting page name

This commit is contained in:
Ted Unangst 2019-09-05 17:45:10 -04:00
parent ed7e687370
commit 2cb07e026a
2 changed files with 4 additions and 2 deletions

View File

@ -169,8 +169,10 @@ func homepage(w http.ResponseWriter, r *http.Request) {
} else { } else {
userid = u.UserID userid = u.UserID
if r.URL.Path == "/atme" { if r.URL.Path == "/atme" {
templinfo["PageName"] = "atme"
honks = gethonksforme(userid) honks = gethonksforme(userid)
} else { } else {
templinfo["PageName"] = "home"
honks = gethonksforuser(userid) honks = gethonksforuser(userid)
honks = osmosis(honks, userid) honks = osmosis(honks, userid)
} }

View File

@ -14,9 +14,9 @@
{{ if .TopXID }} {{ if .TopXID }}
<div class="info" id="refreshbox"> <div class="info" id="refreshbox">
<script> <script>
var topxid = { "home" : "{{ .TopXID }}" } var topxid = { "{{ .PageName }}" : "{{ .TopXID }}" }
var honksforpage = { } var honksforpage = { }
var thispagename = "home" var thispagename = "{{ .PageName }}"
function fillinhonks(xhr) { function fillinhonks(xhr) {
var doc = xhr.responseXML var doc = xhr.responseXML
topxid[thispagename] = doc.children[0].children[1].children[0].innerText topxid[thispagename] = doc.children[0].children[1].children[0].innerText