all repos — honk @ 85aa13c31a3299ecf4d046b2a0475ba5176057f5

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
<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="">
<input type="hidden" name="CSRF" value="{{ .HonkCSRF }}">
<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 el = document.getElementById("honkform")
	el.style = "display: block"
	if (rid) {
		el.children[0].innerHTML = "tonking " + rid
		el.children[1].value = rid
		el.children[3].value = "@" + hname + " "
	} else {
		el.children[0].innerHTML = ""
		el.children[1].value = ""
	}
	el.scrollIntoView()
}
function updatedonker() {
	var el = document.getElementById("donker")
	el.children[1].textContent = el.children[0].value
}
</script>