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 2013/05/31 13:15:59 UTC

svn commit: r1488160 - in /myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard: msie_6_0/script/ standard/script/

Author: lofwyr
Date: Fri May 31 11:15:59 2013
New Revision: 1488160

URL: http://svn.apache.org/r1488160
Log:
TOBAGO-1177: update jQuery 
  removing jQuery.browser because it's deprecated.
  replaced by own browser detection, we still need it because of browser bugs.

Modified:
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
    myfaces/tobago/branches/tobago-1.5.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-1.5.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-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js?rev=1488160&r1=1488159&r2=1488160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js Fri May 31 11:15:59 2013
@@ -21,7 +21,7 @@
  */
 
 Tobago.fixPngAlphaAll = function(elements) {
-  if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+  if (Tobago.browser.isMsie6) {
     // fix png images
     var images = Tobago.Utils.selectWidthJQuery(elements, "img[src$='.png']");
     images.each(function() {
@@ -38,8 +38,7 @@ Tobago.fixPngAlphaAll = function(element
 };
 
 Tobago.fixPngAlpha = function(element) {
-  if (jQuery.browser.msie
-      && parseInt(jQuery.browser.version) <= 6
+  if (Tobago.browser.isMsie6
       && element.src.toLowerCase().match(/.*png/)
       && Tobago.isActiveXEnabled()) {
     Tobago.fixPngAlphaInternal(element);

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js?rev=1488160&r1=1488159&r2=1488160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js Fri May 31 11:15:59 2013
@@ -162,7 +162,7 @@ Tobago.Menu.open = function(event) {
     sub.css('visibility', 'visible');
     
     // IE6 select-tag fix
-    if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+    if (Tobago.browser.isMsie6) {
       //          sub.css('width', sub.width());
       //          sub.css('height', sub.height());
       //          sub.css('display', 'none');
@@ -193,7 +193,7 @@ Tobago.Menu.closeAll = function() {
 * returns the browser specific event which should be used.
 */
 function compatibleKeyEvent() {
-  return jQuery.browser.msie || jQuery.browser.webkit ? 'keydown' : 'keypress';
+  return Tobago.browser.isMsie || Tobago.browser.isWebkit ? 'keydown' : 'keypress';
 }
 
 Tobago.Menu.mouseOver = function(event) {
@@ -257,7 +257,7 @@ Tobago.Menu.init = function(elements) {
   // IE6 select-tag fix
   // put a iframe inside the div, so that a <select> tag doesn't shine through.
   // the iframe must be resized (see above)
-  if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+  if (Tobago.browser.isMsie6) {
     menus.children("ol").prepend(
         "<iframe class='tobago-menu-ie6bugfix' src='" + Tobago.blankPage + "'></iframe>");
   }

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js?rev=1488160&r1=1488159&r2=1488160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js Fri May 31 11:15:59 2013
@@ -52,7 +52,7 @@ Tobago.Popup.setup = function () {
     shield.attr('id', maxModalPopup.attr('id') + '::shield');
 
     // IE6 doesn't support position:fixed
-    if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+    if (Tobago.browser.isMsie6) {
       shield.css({
         position:'absolute',
         left:-maxModalPopup.offset().left,
@@ -122,7 +122,7 @@ Tobago.Popup.lockBehind = function (popu
     // find the first element in the popup for the focus
     if (firstPopupElement != null) {
       try {
-        if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 8) {
+        if (Tobago.browser.isMsie678) {
           // call the focus asynchronous, because of a bug in IE 6, 7, 8 (IE 9 works fine)
           var focusId = firstPopupElement.attr("id");
           var selector = Tobago.Utils.escapeClientId(focusId).replace(/\\/g, '\\\\');

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1488160&r1=1488159&r2=1488160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Fri May 31 11:15:59 2013
@@ -307,7 +307,7 @@ Tobago.Sheet.prototype.setup = function(
   this.setupResizer();
 
   // IE 6+7
-  if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 7) {
+  if (Tobago.browser.isMsie67) {
     jQuery(Tobago.Utils.escapeClientId(this.id) + ">div>table>colgroup>col").each(function() {
       Tobago.Sheet.fixIE67ColWidth(jQuery(this));
     });
@@ -743,7 +743,7 @@ Tobago.Sheet.prototype.endResize = funct
       var col = jQuery("colgroup>col", table).eq(columnNr);
       col.attr("width", width);
 
-      if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 7) {
+      if (Tobago.browser.isMsie67) {
         Tobago.Sheet.fixIE67ColWidth(col);
 
         table.find(".tobago-sheet-cell-markup-filler").each(function() {

Modified: myfaces/tobago/branches/tobago-1.5.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-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js?rev=1488160&r1=1488159&r2=1488160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.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-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js Fri May 31 11:15:59 2013
@@ -77,5 +77,5 @@ Tobago.Utils.keepElementInVisibleArea = 
 };
 
 Tobago.Utils.acceleratorKeyEvent = function() {
-  return jQuery.browser.webkit || jQuery.browser.mozilla ? 'keydown' : 'keypress';
+  return Tobago.browser.isWebkit || Tobago.browser.isGecko ? 'keydown' : 'keypress';
 };

Modified: myfaces/tobago/branches/tobago-1.5.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-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1488160&r1=1488159&r2=1488160&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.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-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Fri May 31 11:15:59 2013
@@ -136,7 +136,18 @@ var Tobago = {
 
   eventListeners: new Array(),
 
-  browser: undefined,
+  /**
+    * Check browser types and versions.
+    * Please try to use jQuery.support instead of this object!
+    */
+  browser: {
+    isMsie: false,
+    isMsie6: false,
+    isMsie67: false,
+    isMsie678: false,
+    isGecko: false,
+    isWebkit: false
+  },
 
   acceleratorKeys: {
     set: function(keyAccelerator) {
@@ -449,7 +460,7 @@ var Tobago = {
     wait.show();
     overlay.show();
 
-    if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+    if (Tobago.browser.isMsie6) {
       element.children(".tobago-page-overlay")
           .css({
             width:element.css("width"),
@@ -466,7 +477,7 @@ var Tobago = {
         .animate({opacity:'0.8'}, error ? 0 : 250, "linear", function () {
 
           // fix for IE6: reset the src attribute to enable animation
-          if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+          if (Tobago.browser.isMsie6) {
               image.attr("src", image.attr("src"));
           }
         });
@@ -495,7 +506,7 @@ var Tobago = {
   },
 
   ie6bugfix: function(element) {
-    if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+    if (Tobago.browser.isMsie6) {
 
       if (jQuery(element).children(".tobago-page-overlay-ie6bugfix").size() > 0) {
         return; // ignore
@@ -653,7 +664,7 @@ var Tobago = {
           try {
             // LOG.debug("submit form with action: " + Tobago.action.value);
             Tobago.form.submit();
-            if (jQuery.browser.msie) {
+            if (Tobago.browser.isMsie) {
               // without this "redundant" code the animation will not be animated in IE
               var image = jQuery(".tobago-page-overlayCenter img");
               image.appendTo(image.parent());
@@ -1550,9 +1561,32 @@ var Tobago = {
       }
     }
     return result;
+  },
+
+  initBrowser: function () {
+    var ua = navigator.userAgent;
+    if (ua.indexOf("MSIE") > -1) {
+      Tobago.browser.isMsie = true;
+      if (ua.indexOf("MSIE 6") > -1) {
+        Tobago.browser.isMsie6 = true;
+        Tobago.browser.isMsie67 = true;
+        Tobago.browser.isMsie678 = true;
+      } else if (ua.indexOf("MSIE 7") > -1) {
+        Tobago.browser.isMsie67 = true;
+        Tobago.browser.isMsie678 = true;
+      } else if (ua.indexOf("MSIE 8") > -1) {
+        Tobago.browser.isMsie678 = true;
+      }
+    } else if (ua.indexOf("AppleWebKit") > -1) {
+      Tobago.browser.isWebkit = true;
+    } else if (ua.indexOf("Gecko") > -1) {
+      Tobago.browser.isGecko = true;
+    }
   }
 };
 
+Tobago.initBrowser();
+
 jQuery(document).ready(function() {
   Tobago.init();
 });
@@ -1646,7 +1680,7 @@ Tobago.In.prototype.setup = function() {
     ctrl = Tobago.element(this.id);
     Tobago.addBindEventListener(ctrl, 'change', this, 'checkMaxLength');
     Tobago.addBindEventListener(ctrl, 'keypress', this, 'checkMaxLength');
-    if (jQuery.browser.msie) {
+    if (Tobago.browser.isMsie) {
       Tobago.addBindEventListener(ctrl, 'paste', this, 'checkMaxLengthOnPaste');
     }
   }
@@ -2292,7 +2326,7 @@ Tobago.Updater = {
     }
 
     /* TOBAGO-1087: Wait Cursor after AJAX in IE with Websphere 6.1  */
-    if (jQuery.browser.msie) {
+    if (Tobago.browser.isMsie) {
       var body = jQuery("body");
       var originalCursor = body.css("cursor");
       body.css("cursor", "default");