[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_files/ -> sleight_js.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_files/sleight_js.php,v $
  14  |     $Revision: 1.9 $
  15  |     $Date: 2005/12/25 01:33:05 $
  16  |     $Author: sweetas $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  // Credit to youngpup.net for sorting the annoyince that is ie for us =)
  21  // modified to ignore ie 7+ and figure out where it is on the server.
  22  
  23  // Slieght fix for sites that need it..
  24  
  25  $folder = dirname($_SERVER['PHP_SELF']).'/';
  26  $slashed_folder = str_replace(array("/", "."), array("\\/", "\\."), $folder);
  27  
  28  header("Content-type: application/x-javascript");
  29  
  30  ?>
  31  if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
  32      window.attachEvent("onload", fnLoadPngs);
  33  }
  34  
  35  function fnLoadPngs() {
  36      var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
  37      var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5 && Number(rslt[1]) < 7);
  38  
  39      for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
  40          if (itsAllGood && img.src.match(/\.png$/i) != null) {
  41              fnFixPng(img);
  42              img.attachEvent("onpropertychange", fnPropertyChanged);
  43          }
  44      }
  45  
  46      var nl = document.getElementsByTagName("input");
  47      for (var i = nl.length - 1, e = null; (e = nl[i]); i--) {
  48          if (e.type == 'image') {
  49              if (e.src.match(/\.png$/i) != null) {
  50                  fnFixPng(e);
  51                  e.attachEvent("onpropertychange", fnPropertyChanged);
  52              }
  53          }
  54      }
  55  }
  56  
  57  function fnPropertyChanged() {
  58      if (window.event.propertyName == "src") {
  59          var el = window.event.srcElement;
  60          if (!el.src.match(/<?php echo $slashed_folder; ?>sleight_img\.gif$/i)) {
  61              el.filters.item(0).src = el.src;
  62              el.src = "<?php echo $folder; ?>sleight_img.gif";
  63          }
  64      }
  65  }
  66  
  67  function fnFixPng(img) {
  68      var src = img.src;
  69      img.style.width = img.width + "px";
  70      img.style.height = img.height + "px";
  71      img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
  72      img.src = "<?php echo $folder; ?>sleight_img.gif";
  73  }


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7