all repos — honk @ 3ea050b6e3a83d6b0ce8a56c97f57b85f5e1adf5

my fork of honk

allow replying to off site honks by entering url manually
Ted Unangst tedu@tedunangst.com
Thu, 11 Apr 2019 10:33:05 -0400
commit

3ea050b6e3a83d6b0ce8a56c97f57b85f5e1adf5

parent

85aa13c31a3299ecf4d046b2a0475ba5176057f5

2 files changed, 13 insertions(+), 11 deletions(-)

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

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

{{ template "header.html" . }} <div class="center"> -<div class="info"> +<div class="info" id="infobox"> <p>{{ .ServerMessage }} {{ if .HonkCSRF }} {{ template "honkform.html" . }}
M views/honkform.htmlviews/honkform.html

@@ -1,9 +1,10 @@

<p> <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"> -<p></p> -ly: <input type="text" name="rid" value=""> +<p> +in reply to: <input type="text" name="rid" id="ridinput" value=""> <input type="hidden" name="CSRF" value="{{ .HonkCSRF }}"> +<p> <textarea name="noise" id="honknoise"></textarea> <p> <input type="submit" value="it's gonna be honked">

@@ -11,17 +12,18 @@ <label id="donker" style="margin-left:4em;">attach: <input onchange="updatedonker();" type="file" name="donk"><span></span></label>

</form> <script> function showhonkform(rid, hname) { - var el = document.getElementById("honkform") - el.style = "display: block" + var form = document.getElementById("honkform") + form.style = "display: block" + var ridinput = document.getElementById("ridinput") + var honknoise = document.getElementById("honknoise") if (rid) { - el.children[0].innerHTML = "tonking " + rid - el.children[1].value = rid - el.children[3].value = "@" + hname + " " + ridinput.value = rid + honknoise.value = "@" + hname + " " } else { - el.children[0].innerHTML = "" - el.children[1].value = "" + ridinput.value = "" + honknoise.value = "" } - el.scrollIntoView() + document.getElementById("infobox").scrollIntoView() } function updatedonker() { var el = document.getElementById("donker")