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 2010/08/12 15:56:11 UTC

svn commit: r984780 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js

Author: lofwyr
Date: Thu Aug 12 13:56:10 2010
New Revision: 984780

URL: http://svn.apache.org/viewvc?rev=984780&view=rev
Log:
clean up

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js

Modified: myfaces/tobago/trunk/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/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js?rev=984780&r1=984779&r2=984780&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js Thu Aug 12 13:56:10 2010
@@ -30,7 +30,7 @@ Tobago.fixPngAlphaAll = function() {
     // fix png backgrounds of the labels
     jQuery("label.tobago-label-markup-fatal, label.tobago-label-markup-error, "
         + "label.tobago-label-markup-warn, label.tobago-label-markup-info").each(function() {
-      Tobago.workaroundBackgroundPngAlpha(this);
+      Tobago.fixBackgroundPngAlpha(this);
     });
 
   }
@@ -43,8 +43,7 @@ Tobago.fixPngAlpha = function(element) {
         && parseInt(jQuery.browser.version) <= 6
         && element.src.toLowerCase().match(/.*png/)
         && Tobago.isActiveXEnabled()) {
-      Tobago.addEventListener(element, 'propertychange', Tobago.propertyChange);
-      Tobago.fixImage(element);
+      Tobago.fixPngAlphaInternal(element);
     }
   }
 };
@@ -58,28 +57,18 @@ Tobago.isActiveXEnabled = function () {
   return true;
 };
 
-Tobago.propertyChange = function() {
-  if (event.propertyName != "src") {
-    return;
-  }
-  // if not set to blank (to avoid endless loop)
-  if (! new RegExp(Tobago.pngFixBlankImage).test(event.srcElement.src)) {
-    Tobago.fixImage(event.srcElement);
-  }
-};
-
-Tobago.fixImage = function(element) {
+Tobago.fixPngAlphaInternal = function(element) {
   element.runtimeStyle.backgroundImage = "none";
   element.runtimeStyle.filter
       = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + element.src + "', sizingMethod='scale')";
   element.src = Tobago.pngFixBlankImage;
 };
 
-Tobago.workaroundBackgroundPngAlpha = function(element) {
+Tobago.fixBackgroundPngAlpha = function(element) {
   var label = jQuery(element);
   var url = label.css("background-image");
   label.append("<img src='" + url.substring(5, url.length - 2) + "' />");
-  Tobago.fixImage(label.children("img").get(0));
+  Tobago.fixPngAlphaInternal(label.children("img").get(0));
   label.css("background-image", "none");
 };