allow replying to off site honks by entering url manually
Ted Unangst tedu@tedunangst.com
Thu, 11 Apr 2019 10:33:05 -0400
2 files changed,
13 insertions(+),
11 deletions(-)
M
views/homepage.html
→
views/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.html
→
views/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")