summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-11-24 13:42:33 +0100
committerAndrew Dolgov <[email protected]>2006-11-24 13:42:33 +0100
commitd96d11f4ff0f796cd1dc948bab69241d07326f56 (patch)
treef4b3cca74740a02d680d002bdd7c2438f7e8d71c /functions.js
parent4b6206fa978bde200731872bc4a587d3135cf0a0 (diff)
enable toggling of debug window with shift-d
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/functions.js b/functions.js
index d701710ce..4b610816d 100644
--- a/functions.js
+++ b/functions.js
@@ -1,5 +1,5 @@
var hotkeys_enabled = true;
-
+var debug_mode_enabled = false;
var xmlhttp_rpc = Ajax.getTransport();
function browser_has_opacity() {
@@ -166,6 +166,13 @@ function hotkey_handler(e) {
try {
var keycode;
+ var shift_key = false;
+
+ try {
+ shift_key = e.shiftKey;
+ } catch (e) {
+
+ }
if (!hotkeys_enabled) return;
@@ -226,6 +233,19 @@ function hotkey_handler(e) {
exception_error("hotkey_handler, local:", e);
}
}
+
+ if (keycode == 68 && shift_key) { // d
+ if (!debug_mode_enabled) {
+ document.getElementById('debug_output').style.display = 'block';
+ debug('debug mode activated');
+ } else {
+ document.getElementById('debug_output').style.display = 'none';
+ }
+
+ debug_mode_enabled = !debug_mode_enabled;
+ }
+
+ debug("KP=" + keycode);
} catch (e) {
exception_error("hotkey_handler", e);
}