vgritsenko 2003/09/26 04:52:14
Modified: src/blocks/linotype/samples/scripts editor.js
Log:
Disable "Back" / "Forward" buttons (as far as it possible...)
Revision Changes Path
1.3 +11 -13 cocoon-2.1/src/blocks/linotype/samples/scripts/editor.js
Index: editor.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/linotype/samples/scripts/editor.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- editor.js 25 Sep 2003 12:53:13 -0000 1.2
+++ editor.js 26 Sep 2003 11:52:14 -0000 1.3
@@ -249,10 +249,9 @@
//window.status = "[" + key + "," + ch + "," + e.shiftKey + "," +
e.ctrlKey + "," + e.altKey + "," + e.metaKey + "]";
- /* FIXME: Intentions of this code are not exactly clear, and it disables
- very essential Ctrl+LeftArrow/Ctrl+RightArrow key combinations
try {
- if (e.ctrlKey || e.metaKey) {
+ // Disable "Back" / "Forward" buttons (Alt|Apple+LeftArrow /
Alt|Apple+RightArrow)
+ if (e.altKey || e.metaKey) {
if (key > 0) {
switch (key) {
case 37: // left arrow
@@ -262,15 +261,15 @@
e.returnValue = false;
return false;
}
- } else if (ch > 0) {
- switch (ch) {
- case 91: // [
- case 93: // ]
- e.stopPropagation();
- e.preventDefault();
- e.returnValue = false;
- return false;
- }
+ //} else if (ch > 0) {
+ // switch (ch) {
+ // case 91: // [
+ // case 93: // ]
+ // e.stopPropagation();
+ // e.preventDefault();
+ // e.returnValue = false;
+ // return false;
+ // }
}
//} else if (e.shiftKey && (key == e.DOM_VK_TAB)) {
// editor.execCommand("outdent", false, null);
@@ -282,7 +281,6 @@
// }
}
} catch (e) { }
- */
previousKey = key;
}