all repos — honk @ b368acf1bdb5a4fc12f684ad05a23adabeafe708

my fork of honk

views/honkform.html (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
<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>
<textarea name="noise" id="honknoise"></textarea>
<p>
<input type="submit" value="it's gonna be honked">
<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 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 + " "
	} else {
		ridinput.value = ""
		honknoise.value = ""
	}
	document.getElementById("infobox").scrollIntoView()
}
function updatedonker() {
	var el = document.getElementById("donker")
	el.children[1].textContent = el.children[0].value
}
</script>