32 lines
1.1 KiB
HTML
32 lines
1.1 KiB
HTML
<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>
|
|
in reply to: <input type="text" name="rid" id="ridinput" value="" autocomplete=off>
|
|
<input type="hidden" name="CSRF" value="{{ .HonkCSRF }}">
|
|
<p>
|
|
<label id="donker">attach: <input onchange="updatedonker();" type="file" name="donk"><span></span></label>
|
|
<p>
|
|
<textarea name="noise" id="honknoise">{{ .Noise }}</textarea>
|
|
<p>
|
|
<input type="submit" value="it's gonna be honked">
|
|
<input type="submit" name="preview" value="preview">
|
|
</form>
|
|
<script>
|
|
function showhonkform(rid, hname) {
|
|
var form = document.getElementById("honkform")
|
|
form.style = "display: block"
|
|
var ridinput = document.getElementById("ridinput")
|
|
var honknoise = document.getElementById("honknoise")
|
|
if (rid) {
|
|
ridinput.value = rid
|
|
honknoise.value = "@" + hname + " "
|
|
}
|
|
document.getElementById("infobox").scrollIntoView()
|
|
}
|
|
function updatedonker() {
|
|
var el = document.getElementById("donker")
|
|
el.children[1].textContent = el.children[0].value.slice(-20)
|
|
}
|
|
</script>
|