diff options
author | sembrestels <sembrestels@riseup.net> | 2011-10-13 15:23:11 +0200 |
---|---|---|
committer | sembrestels <sembrestels@riseup.net> | 2011-10-13 15:23:11 +0200 |
commit | 74bd6999c5e5c23ebbf90dbb6bdaabbddd7594cf (patch) | |
tree | 834c120d692be288f261bcae169eedd3d6b31d74 /vendors/dokuwiki/lib/scripts/pngbehavior.htc | |
parent | f8be8643f0faadb2c0ce87d553b7b9d569af5afd (diff) | |
download | elgg-74bd6999c5e5c23ebbf90dbb6bdaabbddd7594cf.tar.gz elgg-74bd6999c5e5c23ebbf90dbb6bdaabbddd7594cf.tar.bz2 |
Rename lib/dokuwiki to vendors/dokuwiki
Diffstat (limited to 'vendors/dokuwiki/lib/scripts/pngbehavior.htc')
-rw-r--r-- | vendors/dokuwiki/lib/scripts/pngbehavior.htc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/vendors/dokuwiki/lib/scripts/pngbehavior.htc b/vendors/dokuwiki/lib/scripts/pngbehavior.htc new file mode 100644 index 000000000..d1db8e765 --- /dev/null +++ b/vendors/dokuwiki/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> |