cvs: docweb /templates/all/www/shared header.tpl.php /www/images spacer.png /www/style pngerizer.js

[email protected] ("Vincent Gevers")
Newsgroups php.doc.web
Message-ID <cvsvincent1122989385@cvsserver>
vincent		Tue Aug  2 09:29:45 2005 EDT

  Added files:                 
    /docweb/www/images	spacer.png 
    /docweb/www/style	pngerizer.js 

  Modified files:              
    /docweb/templates/all/www/shared	header.tpl.php 
  Log:
  Fix for the png issue on IE.
  
  
http://cvs.php.net/diff.php/docweb/templates/all/www/shared/header.tpl.php?r1=1.6&r2=1.7&ty=u
Index: docweb/templates/all/www/shared/header.tpl.php
diff -u docweb/templates/all/www/shared/header.tpl.php:1.6 docweb/templates/all/www/shared/header.tpl.php:1.7
--- docweb/templates/all/www/shared/header.tpl.php:1.6	Sat Jun 11 22:44:17 2005
+++ docweb/templates/all/www/shared/header.tpl.php	Tue Aug  2 09:29:43 2005
@@ -6,6 +6,7 @@
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta http-equiv="Content-Language" content="<?php echo $lang; ?>" />
+ <script type="text/javascript" src="/style/pngerizer.js"></script>
  <link rel="shortcut icon" href="/images/favicon/<?php echo $project; ?>/favicon.ico" />
  <style type="text/css">
   @import url(/style/site.css);

http://cvs.php.net/co.php/docweb/www/style/pngerizer.js?r=1.1&p=1
Index: docweb/www/style/pngerizer.js
+++ docweb/www/style/pngerizer.js
/**********************************************************
Below code derived from Sleight (c) 2001 Aaron Boodman
http://www.youngpup.net
**********************************************************/
window.onload = function() { loadPNGs(); }

function loadPNGs() {
    if (navigator.platform != "Win32"
	|| navigator.appName != "Microsoft Internet Explorer") {
	return;
    }

    for (var i = document.images.length - 1, img = null;
	 (img = document.images[i]); i--) {
	loadPNG(img);
    }
}

function loadPNG(img) {
    if (navigator.platform != "Win32"
	|| navigator.appName != "Microsoft Internet Explorer") {
	return;
    }

    var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
    var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

    if (itsAllGood && img.src.match(/\.png$/i) != null) {
	var src = img.src;
	img.style.width = img.width + "px";
	img.style.height = img.height + "px";
	img.src = "/images/spacer.png";
	img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizing='scale')";
    }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.