2019-07-06 19:48:31 +02:00
|
|
|
<p id="honkformhost">
|
2019-04-09 13:59:33 +02:00
|
|
|
<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">
|
2019-04-11 16:33:05 +02:00
|
|
|
<p>
|
2019-04-19 01:28:19 +02:00
|
|
|
in reply to: <input type="text" name="rid" id="ridinput" value="" autocomplete=off>
|
2019-04-09 13:59:33 +02:00
|
|
|
<input type="hidden" name="CSRF" value="{{ .HonkCSRF }}">
|
2019-04-11 16:33:05 +02:00
|
|
|
<p>
|
2019-06-02 20:51:02 +02:00
|
|
|
<label id="donker">attach: <input onchange="updatedonker();" type="file" name="donk"><span></span></label>
|
|
|
|
<p>
|
2019-06-16 20:11:23 +02:00
|
|
|
<textarea name="noise" id="honknoise">{{ .Noise }}</textarea>
|
2019-04-09 13:59:33 +02:00
|
|
|
<p>
|
|
|
|
<input type="submit" value="it's gonna be honked">
|
2019-06-16 20:11:23 +02:00
|
|
|
<input type="submit" name="preview" value="preview">
|
2019-04-09 13:59:33 +02:00
|
|
|
</form>
|
|
|
|
<script>
|
2019-07-06 19:48:31 +02:00
|
|
|
function showhonkform(elem, rid, hname) {
|
2019-04-11 16:33:05 +02:00
|
|
|
var form = document.getElementById("honkform")
|
|
|
|
form.style = "display: block"
|
2019-07-06 19:48:31 +02:00
|
|
|
if (elem) {
|
|
|
|
form.remove()
|
|
|
|
elem.parentElement.insertAdjacentElement('beforebegin', form)
|
|
|
|
} else {
|
|
|
|
elem = document.getElementById("honkformhost")
|
|
|
|
elem.insertAdjacentElement('afterend', form)
|
|
|
|
}
|
2019-04-11 16:33:05 +02:00
|
|
|
var ridinput = document.getElementById("ridinput")
|
|
|
|
var honknoise = document.getElementById("honknoise")
|
2019-04-09 13:59:33 +02:00
|
|
|
if (rid) {
|
2019-04-11 16:33:05 +02:00
|
|
|
ridinput.value = rid
|
|
|
|
honknoise.value = "@" + hname + " "
|
2019-04-09 13:59:33 +02:00
|
|
|
}
|
2019-07-06 19:48:31 +02:00
|
|
|
//document.getElementById("infobox").scrollIntoView()
|
2019-04-09 13:59:33 +02:00
|
|
|
}
|
|
|
|
function updatedonker() {
|
|
|
|
var el = document.getElementById("donker")
|
2019-06-02 20:51:02 +02:00
|
|
|
el.children[1].textContent = el.children[0].value.slice(-20)
|
2019-04-09 13:59:33 +02:00
|
|
|
}
|
|
|
|
</script>
|