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 {
userid = u.UserID
if r.URL.Path == "/atme" {
templinfo["PageName"] = "atme"
honks = gethonksforme(userid)
} else {
templinfo["PageName"] = "home"
honks = gethonksforuser(userid)
honks = osmosis(honks, userid)
}

View File

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