From b8db261f7f9440a930a0e26f3739239bbe0eeb79 Mon Sep 17 00:00:00 2001
From: ARNO* <arno@rezo.net>
Date: Mon, 6 Mar 2006 18:05:52 +0000
Subject: [PATCH] win_width et win_png toujours

---
 .gitattributes    |  1 +
 dist/win_png.html | 50 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100755 dist/win_png.html

diff --git a/.gitattributes b/.gitattributes
index 409d713311..09cc36975d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -8,6 +8,7 @@ dist/puce.gif -text
 dist/puce_rtl.gif -text
 dist/rien.gif -text
 dist/style_prive.html -text
+dist/win_png.html -text
 ecrire/action/autoriser.php -text
 ecrire/action/ical.php -text
 ecrire/action/iconifier.php -text
diff --git a/dist/win_png.html b/dist/win_png.html
new file mode 100755
index 0000000000..fb5de61d7b
--- /dev/null
+++ b/dist/win_png.html
@@ -0,0 +1,50 @@
+#CACHE{360*1000*0}
+#HTTP_HEADER{Content-Type:text/x-component; charset=iso-8859-15}
+#HTTP_HEADER{Vary: Accept-Encoding}
+<public:component>
+<public:attach event="onpropertychange" onevent="propertyChanged()" />
+<script>
+
+var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32";
+var realSrc;
+var blankSrc = "#URL_SITE_SPIP/dist/rien.gif";
+
+if (supported) fixImage();
+
+function propertyChanged() {
+   if (!supported) return;
+   
+   var pName = event.propertyName;
+   if (pName != "src") return;
+   // if not set to blank
+   if ( ! new RegExp(blankSrc).test(src))
+      fixImage();
+};
+
+function fixImage() {
+   // get src
+   var src = element.src;
+   
+   // check for real change
+   if (src == realSrc) {
+      element.src = blankSrc;
+      return;
+   }
+
+   if ( ! new RegExp(blankSrc).test(src)) {
+      // backup old src
+      realSrc = src;
+   }
+   
+   // test for png
+   if ( /\.png$/.test( realSrc.toLowerCase() ) ) {
+      // set blank image
+      element.src = blankSrc;
+      // set filter
+      element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
+                                     src + "',sizingMethod='image')";
+   }
+}
+
+</script>
+</public:component>
\ No newline at end of file
-- 
GitLab