summaryrefslogtreecommitdiff
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2014-08-10 13:40:53 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2014-08-10 13:40:53 -0400
commit4e6800f06759329f892ca8f40fcf50186b3785e1 (patch)
tree1d26e2a12c44d959919716f43d9de6940dc62729 /lib/js
parent60fbd47e8c5695e3c418f96bab81cb0321359f30 (diff)
Adds AJAX-oriented widget cpassword.
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 76a900f7..5cc49fec 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1050,6 +1050,18 @@ function inp(s, name) {
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 "";