You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/03/11 13:50:46 UTC

svn commit: r1576316 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script: tobago-utils.js tobago.js

Author: lofwyr
Date: Tue Mar 11 12:50:46 2014
New Revision: 1576316

URL: http://svn.apache.org/r1576316
Log:
TOBAGO-1370: Inserting characters by <alt>-<keypad code> did not work

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js?rev=1576316&r1=1576315&r2=1576316&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js Tue Mar 11 12:50:46 2014
@@ -109,6 +109,7 @@ Tobago.Utils.keepElementInVisibleArea = 
   });
 };
 
+/** @deprecated */
 Tobago.Utils.acceleratorKeyEvent = function() {
   return Tobago.browser.isWebkit || Tobago.browser.isGecko ? 'keydown' : 'keypress';
 };

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1576316&r1=1576315&r2=1576316&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Tue Mar 11 12:50:46 2014
@@ -124,18 +124,18 @@ var Tobago = {
       if (this[key]) {
         console.warn('Ignoring duplicate key: ' + keyAccelerator.modifier + '-' + keyAccelerator.key + ' with function: ' + keyAccelerator.func.valueOf()); // @DEV_ONLY
       } else {
-//        console.debug("add accelerator for " + keyAccelerator.modifier + "-" + keyAccelerator.key);
+//        console.debug("add accelerator for " + keyAccelerator.modifier + "-" + keyAccelerator.key); // @DEV_ONLY
         this[key] = keyAccelerator;
       }
     },
 
     get: function(event) {
-      if (!event.type == Tobago.Utils.acceleratorKeyEvent()) {
-        return;
+      if (!(event.type == 'keypress')) {
+        return null;
       }
       var keyCode = event.which ? event.which : event.keyCode;
       if (keyCode == 0) {
-        return;
+        return null;
       }
       var key = String.fromCharCode(keyCode).toLowerCase();
       var mod = '';
@@ -151,7 +151,7 @@ var Tobago = {
       if (mod.length == 0) {
         mod = 'none';
       }
-//      console.debug("event for " + mod + "-" + key);
+//      console.debug("event for " + mod + "-" + key); // @DEV_ONLY
       return this[mod + key];
     },
 
@@ -164,7 +164,7 @@ var Tobago = {
       }
       var key = keyAccelerator.modifier + keyAccelerator.key;
       if (this[key]) {
-//        console.debug("delete accelerator for " + keyAccelerator.modifier + "-" + keyAccelerator.key);
+//        console.debug("delete accelerator for " + keyAccelerator.modifier + "-" + keyAccelerator.key); // @DEV_ONLY
         delete this[key];
       }
     },
@@ -173,10 +173,10 @@ var Tobago = {
       if (! event) {
         event = window.event;
       }
-//      console.debug("keypress: keycode " + (event.which ? event.which : event.keyCode));
+//      console.debug("keypress: keycode " + (event.which ? event.which : event.keyCode)); // @DEV_ONLY
       var keyAccelerator = this.get(event);
       if (keyAccelerator) {
-//        console.debug("accelerator found!");
+//        console.debug("accelerator found!"); // @DEV_ONLY
         event.cancelBubble = true;
         if (event.stopPropagation) {
           event.stopPropagation(); // this is DOM2
@@ -295,7 +295,7 @@ var Tobago = {
     }
     console.timeEnd("[tobago] applicationOnload"); // @DEV_ONLY
 
-    this.addBindEventListener(document, Tobago.Utils.acceleratorKeyEvent(), this.acceleratorKeys, 'observe');
+    this.addBindEventListener(document, 'keypress', this.acceleratorKeys, 'observe');
 
     if (Tobago.resizeAction) {
       // firefox submits an onresize event
@@ -958,7 +958,7 @@ var Tobago = {
     accesskeys.each(function () {
       // setupAccessKey
       var el = jQuery(this);
-      new Tobago.AcceleratorKey(function clickAccelKey() {
+      new Tobago.AcceleratorKey(function () {
         Tobago.clickOnElement(el.attr("id"))}, el.attr("accesskey"));
     });
 
@@ -2039,7 +2039,6 @@ Tobago.Updater = {
 
   update: function(source, actionId, ajaxComponentIds, options) {
 
-//    console.show();
     console.debug('Updater.update(\"' + actionId + '\", \"' + ajaxComponentIds + '\")'); // @DEV_ONLY
 
     if (Tobago.Transport.initTransport()) {