all repos — honk @ a369110825be20779f36a0ac2a96cb2f19e826e2

my fork of honk

expand honk form when editing or previewing
Ted Unangst tedu@tedunangst.com
Sat, 12 Oct 2019 10:38:22 -0400
commit

a369110825be20779f36a0ac2a96cb2f19e826e2

parent

d5d1e19de1cd44b2de7efe60a525d317206a5acf

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

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

@@ -1,6 +1,6 @@

<p id="honkformhost"> <button onclick="showhonkform(); return false"><a href="/newhonk">it's honking time</a></button> -<form id="honkform" action="/honk" method="POST" enctype="multipart/form-data" style="display: none"> +<form id="honkform" action="/honk" method="POST" enctype="multipart/form-data" {{ if not .IsPreview }}style="display: none"{{ end }}> <input type="hidden" name="CSRF" value="{{ .HonkCSRF }}"> <input type="hidden" name="updatexid" value = "{{ .UpdateXID }}"> <input type="hidden" name="rid" id="ridinput" value="{{ .InReplyTo }}">
M views/honkpage.htmlviews/honkpage.html

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

{{ template "honkform.html" . }} {{ end }} </div> -{{ if .HonkCSRF }} +{{ if and .HonkCSRF (not .IsPreview) }} <div class="info" id="refreshbox"> <p><button onclick="refreshhonks(this)">refresh</button><span></span> </div>
M web.goweb.go

@@ -959,6 +959,7 @@ templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)

templinfo["Honks"] = honks templinfo["Noise"] = noise templinfo["ServerMessage"] = "honk edit" + templinfo["IsPreview"] = true templinfo["UpdateXID"] = honk.XID if len(honk.Donks) > 0 { templinfo["SavedFile"] = honk.Donks[0].XID