diff --git a/theme/devel.js b/theme/devel.js deleted file mode 100644 index 6abe921..0000000 --- a/theme/devel.js +++ /dev/null @@ -1,47 +0,0 @@ -// Devel server addons - -// devel_addin drops a bunch of development extensions into element e. -// It will only modify stuff inside e. -function devel_addin(obj, e) { - let h = document.createElement("h2"); - e.appendChild(h); - h.textContent = "Development Options"; - - let g = document.createElement("p"); - e.appendChild(g); - g.innerText = "This section will not appear for participants." - - let keys = Object.keys(obj); - keys.sort(); - for (let key of keys) { - switch (key) { - case "body": - continue; - } - - let d = document.createElement("div"); - e.appendChild(d); - d.classList.add("kvpair"); - - let ktxt = document.createElement("span"); - d.appendChild(ktxt); - ktxt.textContent = key; - - let val = obj[key]; - if (Array.isArray(val)) { - let vi = document.createElement("select"); - d.appendChild(vi); - vi.multiple = true; - for (let a of val) { - let opt = document.createElement("option"); - vi.appendChild(opt); - opt.innerText = a; - } - } else { - let vi = document.createElement("input"); - d.appendChild(vi); - vi.value = val; - vi.disabled = true; - } - } -} \ No newline at end of file diff --git a/theme/moth.js b/theme/moth.js index e81f791..5874d13 100644 --- a/theme/moth.js +++ b/theme/moth.js @@ -3,6 +3,17 @@ var teamId var heartbeatInterval = 40000 +function toast(message, timeout=5000) { + let p = document.createElement("p") + + p.innerText = message + document.getElementById("messages").appendChild(p) + setTimeout( + e => { p.remove() }, + timeout + ) +} + function rpc(url, params={}) { let formData = new FormData() for (let k in params) { @@ -110,11 +121,10 @@ function showPuzzles(teamId) { } function login(e) { + e.preventDefault() let name = document.querySelector("[name=name]").value let id = document.querySelector("[name=id]").value - e.preventDefault() - rpc("register", { name: name, id: id, @@ -148,17 +158,6 @@ function login(e) { }) } -function toast(message, timeout=5000) { - let p = document.createElement("p") - - p.innerText = message - document.getElementById("messages").appendChild(p) - setTimeout( - e => { p.remove() }, - timeout - ) -} - function init() { // Already signed in? let id = sessionStorage.getItem("id") diff --git a/theme/puzzle.html b/theme/puzzle.html index 5c0f3f1..fc03cfa 100644 --- a/theme/puzzle.html +++ b/theme/puzzle.html @@ -5,86 +5,20 @@ - +
Puzzle by