allow replying to off site honks by entering url manually
This commit is contained in:
parent
fde8a2d085
commit
33bf469807
|
@ -1,6 +1,6 @@
|
||||||
{{ template "header.html" . }}
|
{{ template "header.html" . }}
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<div class="info">
|
<div class="info" id="infobox">
|
||||||
<p>{{ .ServerMessage }}
|
<p>{{ .ServerMessage }}
|
||||||
{{ if .HonkCSRF }}
|
{{ if .HonkCSRF }}
|
||||||
{{ template "honkform.html" . }}
|
{{ template "honkform.html" . }}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
<p>
|
<p>
|
||||||
<button onclick="showhonkform(); return false"><a href="/newhonk">it's honking time</a></button>
|
<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">
|
<form id="honkform" action="/honk" method="POST" enctype="multipart/form-data" style="display: none">
|
||||||
<p></p>
|
<p>
|
||||||
ly: <input type="text" name="rid" value="">
|
in reply to: <input type="text" name="rid" id="ridinput" value="">
|
||||||
<input type="hidden" name="CSRF" value="{{ .HonkCSRF }}">
|
<input type="hidden" name="CSRF" value="{{ .HonkCSRF }}">
|
||||||
|
<p>
|
||||||
<textarea name="noise" id="honknoise"></textarea>
|
<textarea name="noise" id="honknoise"></textarea>
|
||||||
<p>
|
<p>
|
||||||
<input type="submit" value="it's gonna be honked">
|
<input type="submit" value="it's gonna be honked">
|
||||||
|
@ -11,17 +12,18 @@ ly: <input type="text" name="rid" value="">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function showhonkform(rid, hname) {
|
function showhonkform(rid, hname) {
|
||||||
var el = document.getElementById("honkform")
|
var form = document.getElementById("honkform")
|
||||||
el.style = "display: block"
|
form.style = "display: block"
|
||||||
|
var ridinput = document.getElementById("ridinput")
|
||||||
|
var honknoise = document.getElementById("honknoise")
|
||||||
if (rid) {
|
if (rid) {
|
||||||
el.children[0].innerHTML = "tonking " + rid
|
ridinput.value = rid
|
||||||
el.children[1].value = rid
|
honknoise.value = "@" + hname + " "
|
||||||
el.children[3].value = "@" + hname + " "
|
|
||||||
} else {
|
} else {
|
||||||
el.children[0].innerHTML = ""
|
ridinput.value = ""
|
||||||
el.children[1].value = ""
|
honknoise.value = ""
|
||||||
}
|
}
|
||||||
el.scrollIntoView()
|
document.getElementById("infobox").scrollIntoView()
|
||||||
}
|
}
|
||||||
function updatedonker() {
|
function updatedonker() {
|
||||||
var el = document.getElementById("donker")
|
var el = document.getElementById("donker")
|
||||||
|
|
Loading…
Reference in New Issue