Mercurial > urweb
diff lib/js/urweb.js @ 2055:7c2229aa22fc
Adds AJAX-oriented widget cpassword.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Sun, 10 Aug 2014 13:40:53 -0400 |
parents | 534577e429e1 |
children | e1879ded8095 |
line wrap: on
line diff
--- a/lib/js/urweb.js Fri Aug 15 18:25:56 2014 -0400 +++ b/lib/js/urweb.js Sun Aug 10 13:40:53 2014 -0400 @@ -1050,6 +1050,18 @@ return x; } +function password(s, name) { + if (suspendScripts) + return; + + var x = input(document.createElement("input"), s, + function(x) { return function(v) { if (x.value != v) x.value = v; }; }, "password", name); + x.value = s.data; + x.onkeyup = x.oninput = x.onchange = x.onpropertychange = function() { sv(s, x.value) }; + + return x; +} + function selectValue(x) { if (x.options.length == 0) return "";