Fixed bug #7817: Transparent PNGs do not work in IE6
authorIngo Renner <ingo.renner@typo3.org>
Sun, 16 Mar 2008 10:51:21 +0000 (10:51 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Sun, 16 Mar 2008 10:51:21 +0000 (10:51 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3432 709f56b5-9817-0410-a4d7-c38de5d9e867

12 files changed:
ChangeLog
typo3/backend.php
typo3/gfx/ie6/arrowdown.gif [new file with mode: 0644]
typo3/gfx/ie6/arrowleft.gif [new file with mode: 0644]
typo3/gfx/ie6/arrowright.gif [new file with mode: 0644]
typo3/gfx/ie6/arrowup.gif [new file with mode: 0644]
typo3/js/iecompatibility.js
typo3/stylesheet.css
typo3/sysext/t3skin/ext_tables.php
typo3/sysext/t3skin/registerIe6Stylesheet.php [new file with mode: 0644]
typo3/sysext/t3skin/stylesheets/ie6.css [new file with mode: 0644]
typo3/sysext/t3skin/stylesheets/modulemenu.css

index 57ed1f4..12c7e55 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-03-16  Ingo Renner  <ingo@typo3.org>
 
        * Fixed bug #7396: hardcoded fieldset and legend around radio buttons
+       * Fixed bug #7817: Transparent PNGs do not work in IE6
 
 2008-03-15  Ingo Renner  <ingo@typo3.org>
 
index 0f79c8b..fed994b 100644 (file)
@@ -97,6 +97,7 @@ class TYPO3backend {
                        'js/sizemanager.js',
                        'js/toolbarmanager.js',
                        'js/modulemenu.js',
+                       'js/iecompatibility.js',
                        '../t3lib/jsfunc.evalfield.js'
                );
 
diff --git a/typo3/gfx/ie6/arrowdown.gif b/typo3/gfx/ie6/arrowdown.gif
new file mode 100644 (file)
index 0000000..0f63a82
Binary files /dev/null and b/typo3/gfx/ie6/arrowdown.gif differ
diff --git a/typo3/gfx/ie6/arrowleft.gif b/typo3/gfx/ie6/arrowleft.gif
new file mode 100644 (file)
index 0000000..dfce021
Binary files /dev/null and b/typo3/gfx/ie6/arrowleft.gif differ
diff --git a/typo3/gfx/ie6/arrowright.gif b/typo3/gfx/ie6/arrowright.gif
new file mode 100644 (file)
index 0000000..55710d5
Binary files /dev/null and b/typo3/gfx/ie6/arrowright.gif differ
diff --git a/typo3/gfx/ie6/arrowup.gif b/typo3/gfx/ie6/arrowup.gif
new file mode 100644 (file)
index 0000000..6b643fa
Binary files /dev/null and b/typo3/gfx/ie6/arrowup.gif differ
index a6fb7c1..829c043 100644 (file)
 ***************************************************************/
 
 
+Element.addMethods({
+       pngHack: function(element) {
+               element = $(element);
+               var transparentGifPath = 'clear.gif';
+
+                       // If there is valid element, it is an image and the image file ends with png:
+               if (Object.isElement(element) && element.tagName == 'IMG' && element.src.endsWith('.png')) {
+                       var alphaImgSrc = element.src;
+                       var sizingMethod = 'scale';
+                       element.src = transparentGifPath;
+               }
+
+               if (alphaImgSrc) {
+                       element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{alphaImgSrc}",sizingMethod="#{sizingMethod}")'.interpolate(
+                       {
+                               alphaImgSrc: alphaImgSrc,
+                               sizingMethod: sizingMethod
+                       });
+               }
+
+               return element;
+       }
+});
+
 var IECompatibility = Class.create({
 
        /**
-        * initialize the compatibility class
+        * initializes the compatibility class
         */
        initialize: function() {
                Event.observe(document, 'dom:loaded', function() {
                        $$('input[type="checkbox"]').invoke('addClassName', 'checkbox');
                }.bind(this));
+
+               Event.observe(window, 'load', function() {
+                       if (Prototype.Browser.IE) {
+                               var version = parseFloat(navigator.appVersion.split(';')[1].strip().split(' ')[1]);
+                               if (version == 6) {
+                                       $$('img').each(function(img){
+                                               img.pngHack();
+                                       });
+                               }
+                       }
+               });
        }
 });
 
-if (Prototype.Browser.IE) {
+if(Prototype.Browser.IE) {
        var TYPO3IECompatibilty = new IECompatibility();
 }
index 1962dbf..bb86021 100755 (executable)
@@ -2537,3 +2537,4 @@ div {
 }
 */
 
+
index f2231eb..690c03e 100644 (file)
@@ -149,5 +149,9 @@ if (TYPO3_MODE=='BE')       {
        $TBE_STYLES['skinImg']['MOD:tools_em/uninstall.gif'] = array($temp_eP.'icons/ext/templavoila/mod1/moduleicon.gif','width="22" height="22"');
 
        //print_a($TBE_STYLES,2);
+
+       $GLOBALS['TYPO3_CONF_VARS']['typo3/backend.php']['additionalBackendItems'][] = t3lib_extMgm::extPath('t3skin').'registerIe6Stylesheet.php';
+
 }
-?>
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/t3skin/registerIe6Stylesheet.php b/typo3/sysext/t3skin/registerIe6Stylesheet.php
new file mode 100644 (file)
index 0000000..dc4823e
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+if(TYPO3_MODE == 'BE') {
+
+               // handle stupid IE6
+       $userAgent = t3lib_div::getIndpEnv('HTTP_USER_AGENT');
+
+       if(!(strpos($userAgent, 'MSIE 6') === false)
+       && strpos($userAgent, 'Opera') === false
+       && strpos($userAgent, 'MSIE 7') === false) {
+                       //make sure we match IE6 but not Opera or IE7
+               $GLOBALS['TYPO3backend']->addCssFile('ie6fix', 'sysext/t3skin/stylesheets/ie6.css');
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/t3skin/stylesheets/ie6.css b/typo3/sysext/t3skin/stylesheets/ie6.css
new file mode 100644 (file)
index 0000000..998c29f
--- /dev/null
@@ -0,0 +1,20 @@
+/* - - - - - - - - - - - - - - - - - - - - -
+
+Title  : TYPO3 IE6 fixes
+Author : Ingo Renner <ingo@typo3.org>
+URL    : http://typo3.org
+
+Description : fixes the stupid Internet Explorer
+
+       $Id$
+
+- - - - - - - - - - - - - - - - - - - - - */
+
+
+#typo3-menu li div.expanded {
+       background-image: url('../../../gfx/ie6/arrowdown.gif');
+}
+
+#typo3-menu li div.collapsed {
+       background-image: url('../../../gfx/ie6/arrowright.gif');
+}
\ No newline at end of file
index 207b6a5..d95c14f 100644 (file)
@@ -35,7 +35,7 @@ TYPO3 backend menu - vertical
        font-size: 11px;
        color: #505d6d;
        border: none;
-       background-color: transparent;
+       background-color: #edeeee;
        padding: 2px 0px 4px 16px;
        margin: 8px 0px 2px 4px;
        height: auto;
@@ -44,12 +44,12 @@ TYPO3 backend menu - vertical
 }
 
 #typo3-menu li div.collapsed {
-       background-image: url(../../../gfx/arrowright.png);
+       background-image: url('../../../gfx/arrowright.png');
        background-repeat: no-repeat;
 }
 
 #typo3-menu li div.expanded {
-       background-image: url(../../../gfx/arrowdown.png);
+       background-image: url('../../../gfx/arrowdown.png');
        background-repeat: no-repeat;
 }