From c962db0783caec9d00a3fe3b01733f1660305834 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 13 Jan 2009 15:23:48 -0500 Subject: Combine lib* directories --- jslib/urweb.js | 72 ---------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 jslib/urweb.js (limited to 'jslib/urweb.js') diff --git a/jslib/urweb.js b/jslib/urweb.js deleted file mode 100644 index 0ee19992..00000000 --- a/jslib/urweb.js +++ /dev/null @@ -1,72 +0,0 @@ -function cons(v, ls) { - return { n : ls, v : v }; -} -function callAll(ls) { - for (; ls; ls = ls.n) - ls.v(); -} - -function sc(v) { - return {v : v, h : null}; -} -function sv(s, v) { - s.v = v; - callAll(s.h); -} -function sg(s) { - return s.v; -} - -function ss(s) { - return s; -} -function sr(v) { - return {v : v, h : null}; -} -function sb(x,y) { - var z = y(x.v); - var s = {v : z.v, h : null}; - - function reZ() { - z.h = cons(function() { s.v = z.v; callAll(s.h); }, z.h); - } - - x.h = cons(function() { z = y(x.v); reZ(); s.v = z.v; callAll(s.h); }, x.h); - reZ(); - - return s; -} - -function myParent() { - var pos = document; - - while (pos.lastChild && pos.lastChild.nodeType == 1) - pos = pos.lastChild; - - return pos.parentNode; -} - -function dyn(s) { - var x = document.createElement("span"); - x.innerHTML = s.v; - myParent().appendChild(x); - s.h = cons(function() { x.innerHTML = s.v }, s.h); -} - -function inp(t, s) { - var x = document.createElement(t); - x.value = s.v; - myParent().appendChild(x); - s.h = cons(function() { x.value = s.v }, s.h); - x.onkeyup = function() { sv(s, x.value) }; -} - -function eh(x) { - return x.split("&").join("&").split("<").join("<").split(">").join(">"); -} - -function ts(x) { return x.toString() } -function bs(b) { return (b ? "True" : "False") } - -function pf() { alert("Pattern match failure") } - -- cgit v1.2.3