all repos — honk @ b6fe1dc53a0e825cef67af8a022f3a814e928186

my fork of honk

glow the selected honk if not first
Ted Unangst tedu@tedunangst.com
Tue, 29 Oct 2019 16:00:41 -0400
commit

b6fe1dc53a0e825cef67af8a022f3a814e928186

parent

10fb81e0cd1a02d41b651b1033428c29080302f5

2 files changed, 7 insertions(+), 4 deletions(-)

jump to
M fun.gofun.go

@@ -55,7 +55,7 @@ for _, h := range honks {

h.What += "ed" if h.What == "tonked" { h.What = "honked back" - h.Style = "subtle" + h.Style += " subtle" } if !h.Public { h.Style += " limited"
M web.goweb.go

@@ -852,7 +852,7 @@ log.Print(err)

} } -func showhonk(w http.ResponseWriter, r *http.Request) { +func showonehonk(w http.ResponseWriter, r *http.Request) { name := mux.Vars(r)["name"] user, err := butwhatabout(name) if err != nil {

@@ -899,7 +899,10 @@ }

rawhonks := gethonksbyconvoy(honk.UserID, honk.Convoy, 0) reversehonks(rawhonks) var honks []*Honk - for _, h := range rawhonks { + for i, h := range rawhonks { + if i > 0 && h.XID == xid { + h.Style += " glow" + } if h.Public && (h.Whofore == 2 || h.IsAcked()) { honks = append(honks, h) }

@@ -1938,7 +1941,7 @@ getters.HandleFunc("/events", homepage)

getters.HandleFunc("/robots.txt", nomoroboto) getters.HandleFunc("/rss", showrss) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}", showuser) - getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/"+honkSep+"/{xid:[[:alnum:]]+}", showhonk) + getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/"+honkSep+"/{xid:[[:alnum:]]+}", showonehonk) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/rss", showrss) posters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/inbox", inbox) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/outbox", outbox)