Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
2054:4ad46302f659 | 2055:7c2229aa22fc |
---|---|
1042 if (suspendScripts) | 1042 if (suspendScripts) |
1043 return; | 1043 return; |
1044 | 1044 |
1045 var x = input(document.createElement("input"), s, | 1045 var x = input(document.createElement("input"), s, |
1046 function(x) { return function(v) { if (x.value != v) x.value = v; }; }, "text", name); | 1046 function(x) { return function(v) { if (x.value != v) x.value = v; }; }, "text", name); |
1047 x.value = s.data; | |
1048 x.onkeyup = x.oninput = x.onchange = x.onpropertychange = function() { sv(s, x.value) }; | |
1049 | |
1050 return x; | |
1051 } | |
1052 | |
1053 function password(s, name) { | |
1054 if (suspendScripts) | |
1055 return; | |
1056 | |
1057 var x = input(document.createElement("input"), s, | |
1058 function(x) { return function(v) { if (x.value != v) x.value = v; }; }, "password", name); | |
1047 x.value = s.data; | 1059 x.value = s.data; |
1048 x.onkeyup = x.oninput = x.onchange = x.onpropertychange = function() { sv(s, x.value) }; | 1060 x.onkeyup = x.oninput = x.onchange = x.onpropertychange = function() { sv(s, x.value) }; |
1049 | 1061 |
1050 return x; | 1062 return x; |
1051 } | 1063 } |