allow replying to off site honks by entering url manually

This commit is contained in:
Ted Unangst 2019-04-11 10:33:05 -04:00
parent fde8a2d085
commit 33bf469807
2 changed files with 13 additions and 11 deletions

View File

@ -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" . }}

View File

@ -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 @@ ly: <input type="text" name="rid" value="">
</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")