Follow-up to #14465: Make use of the new Sprite API throughout the TYPO3 Core Backend...
authorSteffen Kamper <info@sk-typo3.de>
Tue, 22 Jun 2010 11:22:43 +0000 (11:22 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 22 Jun 2010 11:22:43 +0000 (11:22 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8029 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/t3skin/pngfix/class.tx_templatehook.php
typo3/sysext/t3skin/pngfix/iepngfix.htc [deleted file]
typo3/sysext/t3skin/pngfix/iepngfix.js [deleted file]
typo3/sysext/t3skin/pngfix/iepngfix.php [deleted file]

index 2cfdb61..2956b18 100644 (file)
@@ -9,10 +9,8 @@ class tx_templatehook {
                && strpos($userAgent, 'Opera') === false
                && strpos($userAgent, 'MSIE 7') === false) {
                                //make sure we match IE6 but not Opera or IE7
-                               $parent->loadJavascriptLib('sysext/t3skin/pngfix/iepngfix.js');
-                               $params['pageRenderer']->addCssInlineBlock('iepngfix', ".t3-icon, .htmlarea .toolbar .x-btn-text, .htmlarea-window .x-panel-icon { behavior: url('" . $parent->backPath . 'sysext/t3skin/pngfix/iepngfix.php' . "\');");
+                       $params['pageRenderer']->addCssFile($parent->backPath . 'sysext/t3skin/stylesheets/ie6/z_t3-icons-gifSprites.css');
                }
-
        }
 }
 
diff --git a/typo3/sysext/t3skin/pngfix/iepngfix.htc b/typo3/sysext/t3skin/pngfix/iepngfix.htc
deleted file mode 100644 (file)
index 0427ee2..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-<public:component>\r
-<script type="text/javascript">\r
-\r
-// IE5.5+ PNG Alpha Fix v2.0 Alpha\r
-// (c) 2004-2009 Angus Turnbull http://www.twinhelix.com\r
-\r
-// This is licensed under the GNU LGPL, version 2.1 or later.\r
-// For details, see: http://creativecommons.org/licenses/LGPL/2.1/\r
-\r
-var IEPNGFix = window.IEPNGFix || {};\r
-IEPNGFix.data = IEPNGFix.data || {};\r
-\r
-\r
-// CONFIG: blankImg is the path to blank.gif, *relative to the HTML document*.\r
-// Try either:\r
-// * An absolute path like:  '/images/blank.gif'\r
-// * A path relative to this HTC file like:  thisFolder + 'blank.gif'\r
-var thisFolder = document.URL.replace(/(\\|\/)[^\\\/]*$/, '/');\r
-IEPNGFix.blankImg = thisFolder + 'iepngfix.gif';\r
-\r
-\r
-IEPNGFix.fix = function(elm, src, t) {\r
-       // Applies an image 'src' to an element 'elm' using the DirectX filter.\r
-       // If 'src' is null, filter is disabled.\r
-       // Disables the 'hook' to prevent infinite recursion on setting BG/src.\r
-       // 't' = type, where background tile = 0, background = 1, IMG SRC = 2.\r
-\r
-       var h = this.hook.enabled;\r
-       this.hook.enabled = 0;\r
-\r
-       var f = 'DXImageTransform.Microsoft.AlphaImageLoader';\r
-               src = (src || '').replace(/\(/g, '%28').replace(/\)/g, '%29');\r
-\r
-       if (\r
-               src && !(/IMG|INPUT/.test(elm.nodeName) && (t != 2)) &&\r
-               elm.currentStyle.width == 'auto' && elm.currentStyle.height == 'auto'\r
-       ) {\r
-               if (elm.offsetWidth) {\r
-                       elm.style.width = elm.offsetWidth + 'px';\r
-               }\r
-               if (elm.clientHeight) {\r
-                       elm.style.height = elm.clientHeight + 'px';\r
-               }\r
-               if (elm.currentStyle.display == 'inline') {\r
-                       elm.style.display = 'inline-block';\r
-               }\r
-       }\r
-       \r
-       if (t == 1) {\r
-               elm.style.backgroundImage = 'url("' + this.blankImg + '")';\r
-       }\r
-       if (t == 2) {\r
-               elm.src = this.blankImg;\r
-       }\r
-\r
-       if (elm.filters[f]) {\r
-               elm.filters[f].enabled = src ? true : false;\r
-               if (src) {\r
-                       elm.filters[f].src = src;\r
-               }\r
-       } else if (src) {\r
-               elm.style.filter = 'progid:' + f + '(src="' + src +\r
-                       '",sizingMethod="' + (t == 2 ? 'scale' : 'crop') + '")';\r
-       }\r
-\r
-       this.hook.enabled = h;\r
-};\r
-\r
-\r
-IEPNGFix.process = function(elm, init) {\r
-       // Checks the onpropertychange event (on first 'init' run, a fake event)\r
-       // and calls the filter-applying-functions.\r
-\r
-       if (\r
-               !/MSIE (5\.5|6)/.test(navigator.userAgent) ||\r
-               typeof elm.filters == 'unknown'\r
-       ) {\r
-               return;\r
-       }\r
-       if (!this.data[elm.uniqueID]) {\r
-               this.data[elm.uniqueID] = {\r
-                       className: ''\r
-               };\r
-       }\r
-       var data = this.data[elm.uniqueID],\r
-               evt = init ? { propertyName: 'src,backgroundImage' } : event,\r
-               isSrc = /src/.test(evt.propertyName),\r
-               isBg = /backgroundImage/.test(evt.propertyName),\r
-               isPos = /width|height|background(Pos|Rep)/.test(evt.propertyName),\r
-               isClass = !init && ((elm.className != data.className) &&\r
-                       (elm.className || data.className));\r
-       if (!(isSrc || isBg || isPos || isClass)) {\r
-               return;\r
-       }\r
-       data.className = elm.className;\r
-       var blank = this.blankImg.match(/([^\/]+)$/)[1],\r
-               eS = elm.style,\r
-               eCS = elm.currentStyle;\r
-\r
-       // Required for Whatever:hover - erase set BG if className changes.\r
-       if (\r
-               isClass && (eS.backgroundImage.indexOf('url(') == -1 ||\r
-               eS.backgroundImage.indexOf(blank) > -1)\r
-       ) {\r
-               return setTimeout(function() {\r
-                       eS.backgroundImage = '';\r
-               }, 0);\r
-       }\r
-\r
-       // Foregrounds.\r
-       if (isSrc && elm.src && { IMG: 1, INPUT: 1 }[elm.nodeName]) {\r
-               if ((/\.png/i).test(elm.src)) {\r
-                       if (!elm.oSrc) {\r
-                               // MM rollover compat\r
-                               elm.oSrc = elm.src;\r
-                       }\r
-                       this.fix(elm, elm.src, 2);\r
-               } else if (elm.src.indexOf(blank) == -1) {\r
-                       this.fix(elm, '');\r
-               }\r
-       }\r
-\r
-       // Backgrounds.\r
-       var bgSrc = eCS.backgroundImage || eS.backgroundImage;\r
-       if ((bgSrc + elm.src).indexOf(blank) == -1) {\r
-               var bgPNG = bgSrc.match(/url[("']+(.*\.png[^\)"']*)[\)"']/i);\r
-               if (bgPNG) {\r
-                       if (this.tileBG && !{ IMG: 1, INPUT: 1 }[elm.nodeName]) {\r
-                               this.tileBG(elm, bgPNG[1]);\r
-                               this.fix(elm, '', 1);\r
-                       } else {\r
-                               if (data.tiles && data.tiles.src) {\r
-                                       this.tileBG(elm, '');\r
-                               }\r
-                               this.fix(elm, bgPNG[1], 1);\r
-                               this.childFix(elm);\r
-                       }\r
-               } else {\r
-                       if (data.tiles && data.tiles.src) {\r
-                               this.tileBG(elm, '');\r
-                       }\r
-                       this.fix(elm, '');\r
-               }\r
-       } else if ((isPos || isClass) && data.tiles && data.tiles.src) {\r
-               this.tileBG(elm, data.tiles.src);\r
-       }\r
-/*\r
-       if (init) {\r
-               this.hook.enabled = 1;\r
-               elm.attachEvent('onpropertychange', this.hook);\r
-       }*/\r
-};\r
-\r
-\r
-IEPNGFix.childFix = function(elm) {\r
-       // "hasLayout" fix for unclickable children inside PNG backgrounds.\r
-       var tags = [\r
-                       'a',\r
-                       'input',\r
-                       'select',\r
-                       'textarea',\r
-                       'button',\r
-                       'iframe',\r
-                       'object'\r
-               ],\r
-               t = tags.length,\r
-               tFix = [];\r
-       while (t--) {\r
-               var pFix = elm.all.tags(tags[t]),\r
-                       e = pFix.length;\r
-               while (e--) {\r
-                       tFix.push(pFix[e]);\r
-               }\r
-       }\r
-       t = tFix.length;\r
-       if (t && (/relative|absolute/i).test(elm.currentStyle.position)) {\r
-               alert('IEPNGFix: Unclickable children of element:' +\r
-                       '\n\n<' + elm.nodeName + (elm.id && ' id=' + elm.id) + '>');\r
-       }\r
-       while (t--) {\r
-               if (!(/relative|absolute/i).test(tFix[t].currentStyle.position)) {\r
-                       tFix[t].style.position = 'relative';\r
-               }\r
-       }\r
-};\r
-\r
-\r
-IEPNGFix.hook = function() {\r
-       if (IEPNGFix.hook.enabled) {\r
-               IEPNGFix.process(element, 0);\r
-       }\r
-};\r
-\r
-\r
-IEPNGFix.process(element, 1);\r
-\r
-</script>\r
-</public:component>\r
diff --git a/typo3/sysext/t3skin/pngfix/iepngfix.js b/typo3/sysext/t3skin/pngfix/iepngfix.js
deleted file mode 100644 (file)
index 3526a2e..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
-// (c) 2008-2009 Angus Turnbull http://www.twinhelix.com
-
-// This is licensed under the GNU LGPL, version 2.1 or later.
-// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
-
-var IEPNGFix = window.IEPNGFix || {};
-
-IEPNGFix.tileBG = function(elm, pngSrc, ready) {
-       // Params: A reference to a DOM element, the PNG src file pathname, and a
-       // hidden "ready-to-run" passed when called back after image preloading.
-
-       var data = this.data[elm.uniqueID],
-               elmW = Math.max(elm.clientWidth, elm.scrollWidth),
-               elmH = Math.max(elm.clientHeight, elm.scrollHeight),
-               bgX = elm.currentStyle.backgroundPositionX,
-               bgY = elm.currentStyle.backgroundPositionY,
-               bgR = elm.currentStyle.backgroundRepeat;
-
-       // Cache of DIVs created per element, and image preloader/data.
-       if (!data.tiles) {
-               data.tiles = {
-                       elm: elm,
-                       src: '',
-                       cache: [],
-                       img: new Image(),
-                       old: {}
-               };
-       }
-       var tiles = data.tiles,
-               pngW = tiles.img.width,
-               pngH = tiles.img.height;
-
-       if (pngSrc) {
-               if (!ready && pngSrc != tiles.src) {
-                       // New image? Preload it with a callback to detect dimensions.
-                       tiles.img.onload = function() {
-                               this.onload = null;
-                               IEPNGFix.tileBG(elm, pngSrc, 1);
-                       };
-                       return tiles.img.src = pngSrc;
-               }
-       } else {
-               // No image?
-               if (tiles.src) ready = 1;
-               pngW = pngH = 0;
-       }
-       tiles.src = pngSrc;
-
-       if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
-               bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
-               return;
-       }
-
-       // Convert English and percentage positions to pixels.
-       var pos = {
-                       top: '0%',
-                       left: '0%',
-                       center: '50%',
-                       bottom: '100%',
-                       right: '100%'
-               },
-               x,
-               y,
-               pc;
-       x = pos[bgX] || bgX;
-       y = pos[bgY] || bgY;
-       if (pc = x.match(/(\d+)%/)) {
-               x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
-       }
-       if (pc = y.match(/(\d+)%/)) {
-               y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
-       }
-       x = parseInt(x);
-       y = parseInt(y);
-
-       var repeatX = false;
-       var repeatY = false;
-       
-       // Go!
-       this.hook.enabled = 0;
-       if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
-               elm.style.position = 'relative';
-       } 
-       var count = 0,
-               xPos,
-               maxX = repeatX ? elmW : x + 0.1,
-               yPos,
-               maxY = repeatY ? elmH : y + 0.1,
-               d,
-               s,
-               isNew;
-       if (pngW && pngH) {
-               for (xPos = x; xPos < maxX; xPos += pngW) {
-                       for (yPos = y; yPos < maxY; yPos += pngH) {
-                               isNew = 0;
-                               if (!tiles.cache[count]) {
-                                       tiles.cache[count] = document.createElement('div');
-                                       isNew = 1;
-                               }
-                               var clipR = Math.max(0, xPos + pngW > elmW ? elmW - xPos : pngW),
-                                       clipB = Math.max(0, yPos + pngH > elmH ? elmH - yPos : pngH);
-                               d = tiles.cache[count];
-                               s = d.style;
-                               s.behavior = 'none';
-                               s.left = (xPos - parseInt(elm.currentStyle.paddingLeft)) + 'px';
-                               s.top = yPos + 'px';
-                               s.width = clipR + 'px';
-                               s.height = clipB + 'px';
-                               s.clip = 'rect(' +
-                                       (yPos < 0 ? 0 - yPos : 0) + 'px,' +
-                                       clipR + 'px,' +
-                                       clipB + 'px,' +
-                                       (xPos < 0 ? 0 - xPos : 0) + 'px)';
-                               s.display = 'block';
-                               if (isNew) {
-                                       s.position = 'absolute';
-                                       s.zIndex = -999;
-                                       if (elm.firstChild) {
-                                               elm.insertBefore(d, elm.firstChild);
-                                       } else {
-                                               elm.appendChild(d);
-                                       }
-                               }
-                               this.fix(d, pngSrc, 0);
-                               count++;
-                       }
-               }
-       }
-       while (count < tiles.cache.length) {
-               this.fix(tiles.cache[count], '', 0);
-               tiles.cache[count++].style.display = 'none';
-       }
-
-       this.hook.enabled = 1;
-
-       // Cache so updates are infrequent.
-       tiles.old = {
-               w: elmW,
-               h: elmH,
-               x: bgX,
-               y: bgY,
-               r: bgR
-       };
-};
-
-
-IEPNGFix.update = function() {
-       // Update all PNG backgrounds.
-       for (var i in IEPNGFix.data) {
-               var t = IEPNGFix.data[i].tiles;
-               if (t && t.elm && t.src) {
-                       IEPNGFix.tileBG(t.elm, t.src);
-               }
-       }
-};
-IEPNGFix.update.timer = 0;
-
-if (window.attachEvent && !window.opera) {
-       window.attachEvent('onresize', function() {
-               clearTimeout(IEPNGFix.update.timer);
-               IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
-       });
-}
diff --git a/typo3/sysext/t3skin/pngfix/iepngfix.php b/typo3/sysext/t3skin/pngfix/iepngfix.php
deleted file mode 100644 (file)
index a557b23..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-// Use this file in your CSS in place of the .HTC file if it works offline but not online.
-// It will send the correct MIME type so that IE will execute the script correctly.
-
-header('Content-Type: text/x-component');
-header('Expires: '.gmdate('D, d M Y H:i:s', time()+60*60*24*365).' GMT');
-header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime('iepngfix.htc')).' GMT');
-include('iepngfix.htc');
-
-?>