LP#826917: Marc editor, CTRL+F6, F7, F8 no longer working on 2.0+
authorMark Cooper <markchristophercooper@gmail.com>
Wed, 10 Oct 2012 04:04:32 +0000 (21:04 -0700)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 22 Oct 2012 16:05:01 +0000 (12:05 -0400)
Updated marcedit.js to recognize F6/7/8 according to codes at:
http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes.
Did not modify behavior (so input focus is not adjusted post record load).

Signed-off-by: Mark Cooper <markchristophercooper@gmail.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/xul/staff_client/server/cat/marcedit.js

index 39fcca5..1fbf544 100644 (file)
@@ -310,7 +310,7 @@ function my_init() {
                 { label : $('catStrings').getString('staff.cat.marcedit.replace_006.label'),
                   oncommand : 
                     'var e = document.createEvent("KeyEvents");' +
-                    'e.initKeyEvent("keypress",1,1,null,1,0,0,0,64,0);' +
+                    'e.initKeyEvent("keypress",1,1,null,1,0,0,0,117,0);' +
                     'current_focus.inputField.dispatchEvent(e);'
                  }
             )
@@ -321,7 +321,7 @@ function my_init() {
                 { label : $('catStrings').getString('staff.cat.marcedit.replace_007.label'),
                   oncommand : 
                     'var e = document.createEvent("KeyEvents");' +
-                    'e.initKeyEvent("keypress",1,1,null,1,0,0,0,65,0);' +
+                    'e.initKeyEvent("keypress",1,1,null,1,0,0,0,118,0);' +
                     'current_focus.inputField.dispatchEvent(e);'
                 }
             )
@@ -332,7 +332,7 @@ function my_init() {
                 { label : $('catStrings').getString('staff.cat.marcedit.replace_008.label'),
                   oncommand : 
                     'var e = document.createEvent("KeyEvents");' +
-                    'e.initKeyEvent("keypress",1,1,null,1,0,0,0,66,0);' +
+                    'e.initKeyEvent("keypress",1,1,null,1,0,0,0,119,0);' +
                     'current_focus.inputField.dispatchEvent(e);'
                 }
             )
@@ -684,13 +684,13 @@ function createMARCTextbox (element,attrs) {
                     event.preventDefault();
                     return false;
                 }
-            } else if (event.keyCode == 64 && event.ctrlKey) { // ctrl + F6
+            } else if (event.keyCode == 117 && event.ctrlKey) { // ctrl + F6
                 createControlField('006','                                        ');
                 loadRecord();
-            } else if (event.keyCode == 65 && event.ctrlKey) { // ctrl + F7
+            } else if (event.keyCode == 118 && event.ctrlKey) { // ctrl + F7
                 createControlField('007','                                        ');
                 loadRecord();
-            } else if (event.keyCode == 66 && event.ctrlKey) { // ctrl + F8
+            } else if (event.keyCode == 119 && event.ctrlKey) { // ctrl + F8
                 createControlField('008','                                        ');
                 loadRecord();
             }