all repos — honk @ 5f581e0167c9b9f9d661c0fdf529a88e1ed551e0

my fork of honk

more consistency in page switching
Ted Unangst tedu@tedunangst.com
Mon, 07 Oct 2019 16:33:31 -0400
commit

5f581e0167c9b9f9d661c0fdf529a88e1ed551e0

parent

4f19ceba2f75702dfeea5ab1604eef55b4e2ddd1

3 files changed, 7 insertions(+), 7 deletions(-)

jump to
M views/honkpage.htmlviews/honkpage.html

@@ -10,7 +10,7 @@ {{ if .HonkCSRF }}

{{ template "honkform.html" . }} {{ end }} </div> -{{ if .TopXID }} +{{ if .HonkCSRF }} <div class="info" id="refreshbox"> <p><button onclick="refreshhonks(this)">refresh</button><span></span> </div>
M views/honkpage.jsviews/honkpage.js

@@ -164,6 +164,9 @@ return false

} switchtopage(name, arg) var url = evt.srcElement.href + if (!url) { + url = evt.srcElement.parentElement.href + } history.pushState(newpagestate(name, arg), "some title", url) window.scrollTo(0, 0) return false
M web.goweb.go

@@ -99,9 +99,6 @@ templinfo["PageName"] = "home"

honks = gethonksforuser(userid) honks = osmosis(honks, userid) } - if len(honks) > 0 { - templinfo["TopXID"] = honks[0].XID - } templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) }

@@ -582,9 +579,6 @@ templinfo["PageName"] = "combo"

templinfo["PageArg"] = "name" templinfo["ServerMessage"] = "honks by combo: " + name templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) - if len(honks) > 0 { - templinfo["TopXID"] = honks[0].XID - } honkpage(w, u, honks, templinfo) } func showconvoy(w http.ResponseWriter, r *http.Request) {

@@ -720,6 +714,9 @@ w.Header().Set("Cache-Control", "max-age=60")

} reverbolate(userid, honks) templinfo["Honks"] = honks + if len(honks) > 0 { + templinfo["TopXID"] = honks[0].XID + } err := readviews.Execute(w, "honkpage.html", templinfo) if err != nil { log.Print(err)