summaryrefslogtreecommitdiff
path: root/lib/scripts/pngbehavior.htc
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-05 12:38:42 +0200
committerandi <andi@splitbrain.org>2005-06-05 12:38:42 +0200
commitf62ea8a1d1cf10eddeae777b11420624e111b7ea (patch)
tree87a15e898308a5de1ef37874645a4cdcb83c707b /lib/scripts/pngbehavior.htc
parent248a73214063d2fe47787c8c4aa292777cddb12b (diff)
downloadrpg-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.gz
rpg-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.bz2
directory layout cleanup !IMPORTANT
This patch changes the directory structure of dokuwiki as suggested in http://www.freelists.org/archives/dokuwiki/06-2005/msg00045.html As the changes.log is not managed through darcs you need to move it your self to the new location in data/changes.log I think I modified the code at all nessessary places, but I may have forgotten a few things. darcs-hash:20050605103842-9977f-af20f63c1d604888375d175d89ac6bd71566d47d.gz
Diffstat (limited to 'lib/scripts/pngbehavior.htc')
-rw-r--r--lib/scripts/pngbehavior.htc53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/scripts/pngbehavior.htc b/lib/scripts/pngbehavior.htc
new file mode 100644
index 000000000..d1db8e765
--- /dev/null
+++ b/lib/scripts/pngbehavior.htc
@@ -0,0 +1,53 @@
+// this is an ugly fix to make Internet Explorer work with transparent
+// PNG images - do your self a favour and use a real browser!
+
+<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 = DOKU_BASE+"lib/images/blank.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='scale')";
+ }
+ else {
+ // remove filter
+ element.runtimeStyle.filter = "";
+ }
+}
+
+</script>
+</public:component>