fixes issue 37940: Clean up unused shortcuts in the Login page
authorCarlos Aristu <carlos.aristu@openbravo.com>
Wed, 16 Jan 2019 13:32:57 +0100
changeset 35323 7f68f19b9b80
parent 35322 0906b858ed6e
child 35324 f56c59c75e26
fixes issue 37940: Clean up unused shortcuts in the Login page
src/org/openbravo/erpCommon/security/Login.html
web/js/login.js
web/js/utils.js
--- a/src/org/openbravo/erpCommon/security/Login.html	Thu Nov 22 17:36:26 2018 +0100
+++ b/src/org/openbravo/erpCommon/security/Login.html	Wed Jan 16 13:32:57 2019 +0100
@@ -55,7 +55,7 @@
 var recBrowserSafari = '12.0.0.0';
 
 // currentRevision must be the same value as the one returned by getCurrentRevision() (see utils.js)
-var currentRevision = '35310';
+var currentRevision = '35323';
 
 beforeLoadDo();
 </script>
--- a/web/js/login.js	Thu Nov 22 17:36:26 2018 +0100
+++ b/web/js/login.js	Wed Jan 16 13:32:57 2019 +0100
@@ -411,40 +411,16 @@
 
 function enableEditionShortcuts() {
   try {
-    this.keyArray = new Array();
-    getEditionShortcuts('applicationCommonKeys');
-    getEditionShortcuts('windowCommonKeys');
-    getEditionShortcuts('editionSpecificKeys');
-    getEditionShortcuts('genericTreeKeys');
+    getEditionShortcuts();
     enableDefaultAction();
   } catch (e) {}
   keyDownManagement();
   keyUpManagement();
 }
 
-function getEditionShortcuts(type) {
-  if (type == null || type == "" || type == "null") {
-    return;
-  } else if (type == 'applicationCommonKeys') {
-    // don't override browser shortcuts in case of MDI environment
-    if (!isWindowInMDIContext) {
-      this.keyArray.splice(keyArray.length - 1, 0, new keyArrayItem("M", "executeMenuButton('buttonExpand');executeMenuButton('buttonCollapse');", null, "ctrlKey+shiftKey", false, 'onkeydown'), new keyArrayItem("U", "executeMenuButton('buttonUserOptions');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("Q", "executeMenuButton('buttonQuit');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("F8", "executeMenuButton('buttonAlerts');", null, null, false, 'onkeydown'), new keyArrayItem("F9", "menuShowHide();", null, null, false, 'onkeydown'), new keyArrayItem("I", "executeWindowButton('buttonAbout');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("H", "executeWindowButton('buttonHelp');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("R", "executeWindowButton('buttonRefresh');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("BACKSPACE", "executeWindowButton('buttonBack');", null, "ctrlKey+shiftKey", false, 'onkeydown'));
-    } else {
-      var LayoutMDI = getFrame('LayoutMDI');
-      if (typeof LayoutMDI.OB.Layout.ClassicOBCompatibility.Keyboard === "object" && typeof LayoutMDI.OB.Layout.ClassicOBCompatibility.Keyboard.getMDIKS === "function") {
-        var MDIKeyJSON = LayoutMDI.OB.Layout.ClassicOBCompatibility.Keyboard.getMDIKS();
-        for (var i = 0; i < MDIKeyJSON.length; i++) {
-          this.keyArray.splice(keyArray.length - 1, 0, new keyArrayItem(MDIKeyJSON[i].key, [MDIKeyJSON[i].action, MDIKeyJSON[i].funcParam], null, MDIKeyJSON[i].auxKey, false, 'onkeydown'));
-        }
-      }
-    }
-  } else if (type == 'windowCommonKeys') {
-    this.keyArray.splice(keyArray.length - 1, 0, new keyArrayItem("M", "putFocusOnMenu();", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("F10", "swichSelectedArea();", null, null, false, 'onkeydown'), new keyArrayItem("N", "executeWindowButton('linkButtonNew',true);", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("N", "executeWindowButton('linkButtonSave_Next',true);", null, "ctrlKey+shiftKey", false, 'onkeydown'), new keyArrayItem("G", "executeWindowButton('linkButtonSave_Relation',true);", null, "ctrlKey+shiftKey", false, 'onkeydown'), new keyArrayItem("S", "executeWindowButton('linkButtonSave',true);", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("S", "executeWindowButton('linkButtonSave_New',true);", null, "ctrlKey+shiftKey", false, 'onkeydown'), new keyArrayItem("D", "executeWindowButton('linkButtonDelete');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("Z", "executeWindowButton('linkButtonUndo');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("A", "executeWindowButton('linkButtonAttachment');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("F", "executeWindowButton('linkButtonSearch');executeWindowButton('linkButtonSearchFiltered');", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("HOME", "executeWindowButton('linkButtonFirst',true);", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("END", "executeWindowButton('linkButtonLast',true);", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("LEFTARROW", "executeWindowButton('linkButtonPrevious',true);", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("RIGHTARROW", "executeWindowButton('linkButtonNext',true);", null, "ctrlKey", false, 'onkeydown'), new keyArrayItem("L", "executeWindowButton('linkButtonRelatedInfo');", null, "ctrlKey", false, 'onkeydown'));
-  } else if (type == 'editionSpecificKeys') {
-    this.keyArray.splice(keyArray.length - 1, 0, new keyArrayItem("TAB", "windowTabKey(true);", null, null, false, 'onkeydown'), new keyArrayItem("TAB", "windowTabKey(false);", null, null, false, 'onkeyup'), new keyArrayItem("TAB", "windowShiftTabKey(true);", null, "shiftKey", false, 'onkeydown'), new keyArrayItem("TAB", "windowShiftTabKey(false);", null, "shiftKey", false, 'onkeyup'), new keyArrayItem("ENTER", "windowCtrlShiftEnterKey();", null, "ctrlKey+shiftKey", false, 'onkeydown'), new keyArrayItem("ENTER", "windowCtrlEnterKey();", null, "ctrlKey", true, 'onkeydown'), new keyArrayItem("ENTER", "windowEnterKey();", null, null, true, 'onkeydown'), new keyArrayItem("G", "executeWindowButton('buttonRelation');", null, "ctrlKey", false, 'onkeydown'));
-  } else if (type == 'genericTreeKeys') {
-    this.keyArray.splice(keyArray.length - 1, 0, new keyArrayItem("UPARROW", "windowUpKey();", null, null, true, 'onkeydown'), new keyArrayItem("RIGHTARROW", "windowRightKey();", null, null, true, 'onkeydown'), new keyArrayItem("DOWNARROW", "windowDownKey();", null, null, true, 'onkeydown'), new keyArrayItem("LEFTARROW", "windowLeftKey();", null, null, true, 'onkeydown'), new keyArrayItem("SPACE", "windowSpaceKey();", null, null, true, 'onkeydown'));
-  }
+function getEditionShortcuts() {
+  this.keyArray = new Array();
+  this.keyArray.splice(keyArray.length - 1, 0, new keyArrayItem("TAB", "windowTabKey(true);", null, null, false, 'onkeydown'), new keyArrayItem("TAB", "windowTabKey(false);", null, null, false, 'onkeyup'), new keyArrayItem("TAB", "windowShiftTabKey(true);", null, "shiftKey", false, 'onkeydown'), new keyArrayItem("TAB", "windowShiftTabKey(false);", null, "shiftKey", false, 'onkeyup'), new keyArrayItem("ENTER", "windowCtrlShiftEnterKey();", null, "ctrlKey+shiftKey", false, 'onkeydown'), new keyArrayItem("ENTER", "windowCtrlEnterKey();", null, "ctrlKey", true, 'onkeydown'), new keyArrayItem("ENTER", "windowEnterKey();", null, null, true, 'onkeydown'));
 }
 
 /**
--- a/web/js/utils.js	Thu Nov 22 17:36:26 2018 +0100
+++ b/web/js/utils.js	Wed Jan 16 13:32:57 2019 +0100
@@ -105,7 +105,7 @@
 * Return a number that would be checked at the Login screen to know if the file is cached with the correct version
 */
 function getCurrentRevision() {
-  var number = '35310';
+  var number = '35323';
   return number;
 }