]> git.pond.sub.org Git - eow/blobdiff - static/eow.js
Add logging package. Handle flush prompts.
[eow] / static / eow.js
index a0defc92b9fc76712ba573d994f697d06240f73e..19807e408f2a920c9390ee310b130455c26d9be2 100644 (file)
@@ -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 = "";