X-Git-Url: http://git.pond.sub.org/?p=eow;a=blobdiff_plain;f=static%2Feow.js;h=19807e408f2a920c9390ee310b130455c26d9be2;hp=a0defc92b9fc76712ba573d994f697d06240f73e;hb=761774603f988ef58b11ab22c5bbf862819f9cef;hpb=6b9c566dbd2ad6010cc3805c163eea5320c56f38 diff --git a/static/eow.js b/static/eow.js index a0defc9..19807e4 100644 --- a/static/eow.js +++ b/static/eow.js @@ -1,8 +1,12 @@ +function byId(id) { + return document.getElementById(id); +} + function eowOut(output) { var t = document.createTextNode(output); var p = document.createElement("pre"); p.appendChild(t); - dojo.byId("output").appendChild(p); + byId("output").appendChild(p); window.scrollTo(0, window.scrollMaxY); } @@ -68,8 +72,8 @@ function submit_cmdline(cmdline_form) { }); } -function prompt(minutes, btus) { - dojo.byId("prompt").textContent = "[" + minutes + "," + btus + "]: "; +function prompt(p) { + byId("prompt").textContent = p; get_next_update(); } @@ -79,13 +83,13 @@ function msg(m) { } function setup_client() { - var input = dojo.byId("inputfield"); + var input = byId("inputfield"); input.focus(); } function inputfield_keyup(e) { if (e.keyCode == 13) { // Enter - eowOut(dojo.byId("prompt").textContent + e.target.value); + eowOut(byId("prompt").textContent + e.target.value); submit_cmdline(e.target.form.id); window.scrollTo(0, window.scrollMaxY); e.target.value = "";