diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 9 | ||||
-rw-r--r-- | lib/ur/basis.urs | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 474bdaf6..3a0e7f9f 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -501,6 +501,15 @@ function chk(s) { 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 (); }; diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 02ac0126..ffce96c0 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -734,6 +734,9 @@ con cselect = [Cselect] val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) cselect val coption : unit -> tag [Value = string, Selected = bool] cselect [] [] [] +val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit, + Ontext = transaction unit] ++ boxAttrs) [] + (*** Tables *) val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit |