more consistency in page switching
This commit is contained in:
parent
8187aea4f2
commit
dfb0cab81f
|
@ -10,7 +10,7 @@
|
||||||
{{ template "honkform.html" . }}
|
{{ template "honkform.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ if .TopXID }}
|
{{ if .HonkCSRF }}
|
||||||
<div class="info" id="refreshbox">
|
<div class="info" id="refreshbox">
|
||||||
<p><button onclick="refreshhonks(this)">refresh</button><span></span>
|
<p><button onclick="refreshhonks(this)">refresh</button><span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -164,6 +164,9 @@ function pageswitcher(name, arg) {
|
||||||
}
|
}
|
||||||
switchtopage(name, arg)
|
switchtopage(name, arg)
|
||||||
var url = evt.srcElement.href
|
var url = evt.srcElement.href
|
||||||
|
if (!url) {
|
||||||
|
url = evt.srcElement.parentElement.href
|
||||||
|
}
|
||||||
history.pushState(newpagestate(name, arg), "some title", url)
|
history.pushState(newpagestate(name, arg), "some title", url)
|
||||||
window.scrollTo(0, 0)
|
window.scrollTo(0, 0)
|
||||||
return false
|
return false
|
||||||
|
|
9
web.go
9
web.go
|
@ -99,9 +99,6 @@ func homepage(w http.ResponseWriter, r *http.Request) {
|
||||||
honks = gethonksforuser(userid)
|
honks = gethonksforuser(userid)
|
||||||
honks = osmosis(honks, userid)
|
honks = osmosis(honks, userid)
|
||||||
}
|
}
|
||||||
if len(honks) > 0 {
|
|
||||||
templinfo["TopXID"] = honks[0].XID
|
|
||||||
}
|
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,9 +579,6 @@ func showcombo(w http.ResponseWriter, r *http.Request) {
|
||||||
templinfo["PageArg"] = "name"
|
templinfo["PageArg"] = "name"
|
||||||
templinfo["ServerMessage"] = "honks by combo: " + name
|
templinfo["ServerMessage"] = "honks by combo: " + name
|
||||||
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
if len(honks) > 0 {
|
|
||||||
templinfo["TopXID"] = honks[0].XID
|
|
||||||
}
|
|
||||||
honkpage(w, u, honks, templinfo)
|
honkpage(w, u, honks, templinfo)
|
||||||
}
|
}
|
||||||
func showconvoy(w http.ResponseWriter, r *http.Request) {
|
func showconvoy(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -720,6 +714,9 @@ func honkpage(w http.ResponseWriter, u *login.UserInfo, honks []*Honk, templinfo
|
||||||
}
|
}
|
||||||
reverbolate(userid, honks)
|
reverbolate(userid, honks)
|
||||||
templinfo["Honks"] = honks
|
templinfo["Honks"] = honks
|
||||||
|
if len(honks) > 0 {
|
||||||
|
templinfo["TopXID"] = honks[0].XID
|
||||||
|
}
|
||||||
err := readviews.Execute(w, "honkpage.html", templinfo)
|
err := readviews.Execute(w, "honkpage.html", templinfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
|
|
Loading…
Reference in New Issue