You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sc...@apache.org on 2006/02/16 19:02:54 UTC

svn commit: r378318 - in /myfaces: core/trunk/api/src/site/resources/css/ core/trunk/api/src/site/resources/images/ core/trunk/impl/src/site/resources/css/ core/trunk/impl/src/site/resources/images/ site/trunk/src/site/resources/css/ site/trunk/src/sit...

Author: schof
Date: Thu Feb 16 10:02:40 2006
New Revision: 378318

URL: http://svn.apache.org/viewcvs?rev=378318&view=rev
Log:
fixed transparent image problem with IE

Added:
    myfaces/core/trunk/api/src/site/resources/css/png-fix.htc
    myfaces/core/trunk/api/src/site/resources/images/transparent.gif   (with props)
    myfaces/core/trunk/impl/src/site/resources/css/png-fix.htc
    myfaces/core/trunk/impl/src/site/resources/images/transparent.gif   (with props)
    myfaces/site/trunk/src/site/resources/css/png-fix.htc
    myfaces/site/trunk/src/site/resources/images/transparent.gif   (with props)
    myfaces/tomahawk/trunk/core/src/site/resources/css/png-fix.htc
    myfaces/tomahawk/trunk/core/src/site/resources/images/transparent.gif   (with props)
    myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/png-fix.htc
    myfaces/tomahawk/trunk/sandbox/core/src/site/resources/images/transparent.gif   (with props)
Modified:
    myfaces/core/trunk/api/src/site/resources/css/site.css
    myfaces/core/trunk/impl/src/site/resources/css/site.css
    myfaces/site/trunk/src/site/resources/css/site.css
    myfaces/tomahawk/trunk/core/src/site/resources/css/site.css
    myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/site.css

Added: myfaces/core/trunk/api/src/site/resources/css/png-fix.htc
URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/api/src/site/resources/css/png-fix.htc?rev=378318&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/site/resources/css/png-fix.htc (added)
+++ myfaces/core/trunk/api/src/site/resources/css/png-fix.htc Thu Feb 16 10:02:40 2006
@@ -0,0 +1,57 @@
+<public:component lightWeight="true">
+<public:attach event="onpropertychange" onEvent="propertyChanged()" />
+<script>
+/*
+ * Based on
+ * http://www.mongus.net/pngInfo/
+ * and
+ * http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html
+ *
+ */
+
+       var gNeedFix = needFix();
+
+       var transparentImage = "transparent.gif";
+
+       pngFix();
+
+       function propertyChanged() {
+               if (event.propertyName == "src") {
+                       pngFix();
+         }
+       }
+
+       function pngFix() {
+               if (!gNeedFix) {
+                       return;
+               }
+
+               var src = element.src;
+
+               if (src.indexOf(transparentImage) != -1) {
+                       return;
+               }
+
+               if (src.indexOf(".png") == -1) {
+                       return;
+               }
+
+   var w = element.width;
+   var h = element.height;
+               element.src = src.substring(0, src.lastIndexOf('/') + 1)  + transparentImage;
+   element.width = w;
+   element.height = h;
+               element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
+       }
+
+       function needFix() {
+               var pos = navigator.userAgent.indexOf("MSIE ");
+               if (pos == -1) {
+                       return false;
+               }
+               var version = navigator.userAgent.substring(pos + 5);
+               return (((version.indexOf("5.5") == 0) || (version.indexOf("6") == 0)) && (navigator.platform == ("Win32")));
+       }
+
+</script>
+</public:component>
\ No newline at end of file

Modified: myfaces/core/trunk/api/src/site/resources/css/site.css
URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/api/src/site/resources/css/site.css?rev=378318&r1=378317&r2=378318&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/site/resources/css/site.css (original)
+++ myfaces/core/trunk/api/src/site/resources/css/site.css Thu Feb 16 10:02:40 2006
@@ -191,4 +191,8 @@
 #breadcrumbs{
   background: #F0F0F0;
   color: #000000; 
-}
\ No newline at end of file
+}
+
+#banner img {
+ behavior: url(css/png-fix.htc);
+}

Added: myfaces/core/trunk/api/src/site/resources/images/transparent.gif
URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/api/src/site/resources/images/transparent.gif?rev=378318&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/core/trunk/api/src/site/resources/images/transparent.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/core/trunk/impl/src/site/resources/css/png-fix.htc
URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/impl/src/site/resources/css/png-fix.htc?rev=378318&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/site/resources/css/png-fix.htc (added)
+++ myfaces/core/trunk/impl/src/site/resources/css/png-fix.htc Thu Feb 16 10:02:40 2006
@@ -0,0 +1,57 @@
+<public:component lightWeight="true">
+<public:attach event="onpropertychange" onEvent="propertyChanged()" />
+<script>
+/*
+ * Based on
+ * http://www.mongus.net/pngInfo/
+ * and
+ * http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html
+ *
+ */
+
+       var gNeedFix = needFix();
+
+       var transparentImage = "transparent.gif";
+
+       pngFix();
+
+       function propertyChanged() {
+               if (event.propertyName == "src") {
+                       pngFix();
+         }
+       }
+
+       function pngFix() {
+               if (!gNeedFix) {
+                       return;
+               }
+
+               var src = element.src;
+
+               if (src.indexOf(transparentImage) != -1) {
+                       return;
+               }
+
+               if (src.indexOf(".png") == -1) {
+                       return;
+               }
+
+   var w = element.width;
+   var h = element.height;
+               element.src = src.substring(0, src.lastIndexOf('/') + 1)  + transparentImage;
+   element.width = w;
+   element.height = h;
+               element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
+       }
+
+       function needFix() {
+               var pos = navigator.userAgent.indexOf("MSIE ");
+               if (pos == -1) {
+                       return false;
+               }
+               var version = navigator.userAgent.substring(pos + 5);
+               return (((version.indexOf("5.5") == 0) || (version.indexOf("6") == 0)) && (navigator.platform == ("Win32")));
+       }
+
+</script>
+</public:component>
\ No newline at end of file

Modified: myfaces/core/trunk/impl/src/site/resources/css/site.css
URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/impl/src/site/resources/css/site.css?rev=378318&r1=378317&r2=378318&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/site/resources/css/site.css (original)
+++ myfaces/core/trunk/impl/src/site/resources/css/site.css Thu Feb 16 10:02:40 2006
@@ -191,4 +191,8 @@
 #breadcrumbs{
   background: #F0F0F0;
   color: #000000; 
-}
\ No newline at end of file
+}
+
+#banner img {
+ behavior: url(css/png-fix.htc);
+}

Added: myfaces/core/trunk/impl/src/site/resources/images/transparent.gif
URL: http://svn.apache.org/viewcvs/myfaces/core/trunk/impl/src/site/resources/images/transparent.gif?rev=378318&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/core/trunk/impl/src/site/resources/images/transparent.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/site/trunk/src/site/resources/css/png-fix.htc
URL: http://svn.apache.org/viewcvs/myfaces/site/trunk/src/site/resources/css/png-fix.htc?rev=378318&view=auto
==============================================================================
--- myfaces/site/trunk/src/site/resources/css/png-fix.htc (added)
+++ myfaces/site/trunk/src/site/resources/css/png-fix.htc Thu Feb 16 10:02:40 2006
@@ -0,0 +1,57 @@
+<public:component lightWeight="true">
+<public:attach event="onpropertychange" onEvent="propertyChanged()" />
+<script>
+/*
+ * Based on
+ * http://www.mongus.net/pngInfo/
+ * and
+ * http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html
+ *
+ */
+
+       var gNeedFix = needFix();
+
+       var transparentImage = "transparent.gif";
+
+       pngFix();
+
+       function propertyChanged() {
+               if (event.propertyName == "src") {
+                       pngFix();
+         }
+       }
+
+       function pngFix() {
+               if (!gNeedFix) {
+                       return;
+               }
+
+               var src = element.src;
+
+               if (src.indexOf(transparentImage) != -1) {
+                       return;
+               }
+
+               if (src.indexOf(".png") == -1) {
+                       return;
+               }
+
+   var w = element.width;
+   var h = element.height;
+               element.src = src.substring(0, src.lastIndexOf('/') + 1)  + transparentImage;
+   element.width = w;
+   element.height = h;
+               element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
+       }
+
+       function needFix() {
+               var pos = navigator.userAgent.indexOf("MSIE ");
+               if (pos == -1) {
+                       return false;
+               }
+               var version = navigator.userAgent.substring(pos + 5);
+               return (((version.indexOf("5.5") == 0) || (version.indexOf("6") == 0)) && (navigator.platform == ("Win32")));
+       }
+
+</script>
+</public:component>
\ No newline at end of file

Modified: myfaces/site/trunk/src/site/resources/css/site.css
URL: http://svn.apache.org/viewcvs/myfaces/site/trunk/src/site/resources/css/site.css?rev=378318&r1=378317&r2=378318&view=diff
==============================================================================
--- myfaces/site/trunk/src/site/resources/css/site.css (original)
+++ myfaces/site/trunk/src/site/resources/css/site.css Thu Feb 16 10:02:40 2006
@@ -191,4 +191,8 @@
 #breadcrumbs{
   background: #F0F0F0;
   color: #000000; 
-}
\ No newline at end of file
+}
+
+#banner img {
+ behavior: url(css/png-fix.htc);
+}

Added: myfaces/site/trunk/src/site/resources/images/transparent.gif
URL: http://svn.apache.org/viewcvs/myfaces/site/trunk/src/site/resources/images/transparent.gif?rev=378318&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/site/trunk/src/site/resources/images/transparent.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/core/src/site/resources/css/png-fix.htc
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/site/resources/css/png-fix.htc?rev=378318&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/site/resources/css/png-fix.htc (added)
+++ myfaces/tomahawk/trunk/core/src/site/resources/css/png-fix.htc Thu Feb 16 10:02:40 2006
@@ -0,0 +1,57 @@
+<public:component lightWeight="true">
+<public:attach event="onpropertychange" onEvent="propertyChanged()" />
+<script>
+/*
+ * Based on
+ * http://www.mongus.net/pngInfo/
+ * and
+ * http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html
+ *
+ */
+
+       var gNeedFix = needFix();
+
+       var transparentImage = "transparent.gif";
+
+       pngFix();
+
+       function propertyChanged() {
+               if (event.propertyName == "src") {
+                       pngFix();
+         }
+       }
+
+       function pngFix() {
+               if (!gNeedFix) {
+                       return;
+               }
+
+               var src = element.src;
+
+               if (src.indexOf(transparentImage) != -1) {
+                       return;
+               }
+
+               if (src.indexOf(".png") == -1) {
+                       return;
+               }
+
+   var w = element.width;
+   var h = element.height;
+               element.src = src.substring(0, src.lastIndexOf('/') + 1)  + transparentImage;
+   element.width = w;
+   element.height = h;
+               element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
+       }
+
+       function needFix() {
+               var pos = navigator.userAgent.indexOf("MSIE ");
+               if (pos == -1) {
+                       return false;
+               }
+               var version = navigator.userAgent.substring(pos + 5);
+               return (((version.indexOf("5.5") == 0) || (version.indexOf("6") == 0)) && (navigator.platform == ("Win32")));
+       }
+
+</script>
+</public:component>
\ No newline at end of file

Modified: myfaces/tomahawk/trunk/core/src/site/resources/css/site.css
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/site/resources/css/site.css?rev=378318&r1=378317&r2=378318&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/site/resources/css/site.css (original)
+++ myfaces/tomahawk/trunk/core/src/site/resources/css/site.css Thu Feb 16 10:02:40 2006
@@ -191,4 +191,8 @@
 #breadcrumbs{
   background: #F0F0F0;
   color: #000000; 
-}
\ No newline at end of file
+}
+
+#banner img {
+ behavior: url(css/png-fix.htc);
+}

Added: myfaces/tomahawk/trunk/core/src/site/resources/images/transparent.gif
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/site/resources/images/transparent.gif?rev=378318&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/core/src/site/resources/images/transparent.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/png-fix.htc
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/png-fix.htc?rev=378318&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/png-fix.htc (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/png-fix.htc Thu Feb 16 10:02:40 2006
@@ -0,0 +1,57 @@
+<public:component lightWeight="true">
+<public:attach event="onpropertychange" onEvent="propertyChanged()" />
+<script>
+/*
+ * Based on
+ * http://www.mongus.net/pngInfo/
+ * and
+ * http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html
+ *
+ */
+
+       var gNeedFix = needFix();
+
+       var transparentImage = "transparent.gif";
+
+       pngFix();
+
+       function propertyChanged() {
+               if (event.propertyName == "src") {
+                       pngFix();
+         }
+       }
+
+       function pngFix() {
+               if (!gNeedFix) {
+                       return;
+               }
+
+               var src = element.src;
+
+               if (src.indexOf(transparentImage) != -1) {
+                       return;
+               }
+
+               if (src.indexOf(".png") == -1) {
+                       return;
+               }
+
+   var w = element.width;
+   var h = element.height;
+               element.src = src.substring(0, src.lastIndexOf('/') + 1)  + transparentImage;
+   element.width = w;
+   element.height = h;
+               element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
+       }
+
+       function needFix() {
+               var pos = navigator.userAgent.indexOf("MSIE ");
+               if (pos == -1) {
+                       return false;
+               }
+               var version = navigator.userAgent.substring(pos + 5);
+               return (((version.indexOf("5.5") == 0) || (version.indexOf("6") == 0)) && (navigator.platform == ("Win32")));
+       }
+
+</script>
+</public:component>
\ No newline at end of file

Modified: myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/site.css
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/site.css?rev=378318&r1=378317&r2=378318&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/site.css (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/site/resources/css/site.css Thu Feb 16 10:02:40 2006
@@ -191,4 +191,8 @@
 #breadcrumbs{
   background: #F0F0F0;
   color: #000000; 
-}
\ No newline at end of file
+}
+
+#banner img {
+ behavior: url(css/png-fix.htc);
+}

Added: myfaces/tomahawk/trunk/sandbox/core/src/site/resources/images/transparent.gif
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/site/resources/images/transparent.gif?rev=378318&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/site/resources/images/transparent.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream