all repos — honk @ 1761f27cf2fed8468ae6b5af132676352856b037

my fork of honk

consolidate js in one place
Ted Unangst tedu@tedunangst.com
Wed, 18 Sep 2019 15:19:31 -0400
commit

1761f27cf2fed8468ae6b5af132676352856b037

parent

5adca6195f19ebd436633277020775b9e8edda59

2 files changed, 28 insertions(+), 30 deletions(-)

jump to
M views/honkform.htmlviews/honkform.html

@@ -16,33 +16,3 @@ <p>

<input type="submit" value="it's gonna be honked"> <input type="submit" name="preview" value="preview"> </form> -<script> -(function() { - var el = document.getElementById("donkdescriptor") - el.style.display = "none" -})(); -function showhonkform(elem, rid, hname) { - var form = document.getElementById("honkform") - form.style = "display: block" - if (elem) { - form.remove() - elem.parentElement.insertAdjacentElement('beforebegin', form) - } else { - elem = document.getElementById("honkformhost") - elem.insertAdjacentElement('afterend', form) - } - var ridinput = document.getElementById("ridinput") - var honknoise = document.getElementById("honknoise") - if (rid) { - ridinput.value = rid - honknoise.value = "@" + hname + " " - } - document.getElementById("honknoise").focus() -} -function updatedonker() { - var el = document.getElementById("donker") - el.children[1].textContent = el.children[0].value.slice(-20) - var el = document.getElementById("donkdescriptor") - el.style.display = "" -} -</script>
M views/honkpage.jsviews/honkpage.js

@@ -148,3 +148,31 @@ relinkconvoys()

window.onpopstate = statechanger history.replaceState(thispagename, "some title", "") })(); +(function() { + var el = document.getElementById("donkdescriptor") + el.style.display = "none" +})(); +function showhonkform(elem, rid, hname) { + var form = document.getElementById("honkform") + form.style = "display: block" + if (elem) { + form.remove() + elem.parentElement.insertAdjacentElement('beforebegin', form) + } else { + elem = document.getElementById("honkformhost") + elem.insertAdjacentElement('afterend', form) + } + var ridinput = document.getElementById("ridinput") + var honknoise = document.getElementById("honknoise") + if (rid) { + ridinput.value = rid + honknoise.value = "@" + hname + " " + } + document.getElementById("honknoise").focus() +} +function updatedonker() { + var el = document.getElementById("donker") + el.children[1].textContent = el.children[0].value.slice(-20) + var el = document.getElementById("donkdescriptor") + el.style.display = "" +}