diff lib/js/urweb.js @ 1099:118ab9641a64

ctextarea; s/header/include in the manual
author Adam Chlipala <adamc@hcoop.net>
date Tue, 29 Dec 2009 13:34:03 -0500
parents 6e5463a53c3c
children 82ac88b4e0a7
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Dec 29 12:55:26 2009 -0500
+++ b/lib/js/urweb.js	Tue Dec 29 13:34:03 2009 -0500
@@ -501,6 +501,15 @@
   return x;
 }
 
+function tbx(s) {
+  var x = input(document.createElement("textarea"), s,
+        function(x) { return function(v) { if (x.innerHTML != v) x.innerHTML = v; }; });
+  x.innerHTML = s.data;
+  x.onkeyup = function() { sv(s, x.value) };
+
+  return x;
+}
+
 function addOnChange(x, f) {
   var old = x.onchange;
   x.onchange = function() { old(); f (); };