From 961fbcbb3ba96a2cc4ba3ed5e5ca315fee1c72ee Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 18 Sep 2019 15:19:31 -0400 Subject: [PATCH] consolidate js in one place --- views/honkform.html | 30 ------------------------------ views/honkpage.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/views/honkform.html b/views/honkform.html index 41df3b3..35b60b5 100644 --- a/views/honkform.html +++ b/views/honkform.html @@ -16,33 +16,3 @@ description: - diff --git a/views/honkpage.js b/views/honkpage.js index ae8cdef..5bc002b 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -148,3 +148,31 @@ function 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 = "" +}