summaryrefslogtreecommitdiff
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-08-22 19:45:07 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-08-22 19:45:07 -0400
commit746a9d987a0bfe2b3a4d8cd7c7bb4ace819beb2e (patch)
tree08a964618ad4f7fd569d5f7670fe5786ed4a878d /lib/js/urweb.js
parent7765b90d25f98bd9eb0cf2998121e51d4551f733 (diff)
Confirm boxes; proper event handler setting for ctags
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 6215a54c..8ca6b89c 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -512,7 +512,18 @@ function tbx(s) {
function addOnChange(x, f) {
var old = x.onchange;
- x.onchange = function() { old(); f (); };
+ if (old == null)
+ x.onchange = f;
+ else
+ x.onchange = function() { old(); f(); };
+}
+
+function addOnKeyUp(x, f) {
+ var old = x.onkeyup;
+ if (old == null)
+ x.onkeyup = f;
+ else
+ x.onkeyup = function(x) { old(x); f(x); };
}
@@ -893,7 +904,7 @@ function sp(e) {
var uw_event = null;
function kc() {
- return window.event ? uw_event.keyCode : uw_event.which;
+ return window.event ? event.keyCode : (uw_event ? uw_event.keyCode : 0);
}
@@ -1164,5 +1175,12 @@ function execF(f, x) {
}
+// Wrappers
+
+function confrm(s) {
+ return confirm(s) ? true : false;
+}
+
+
// App-specific code