summaryrefslogtreecommitdiff
path: root/presentation/ui/small-white/iepngfix.htc
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2016-01-22 16:55:39 +0100
committerChristoph Helma <helma@in-silico.ch>2016-01-22 16:55:39 +0100
commitfbc7ec1f342767052e23d6430ea94f0ae7c8d27f (patch)
tree106c12587d813d3ab33345cbb2395e135c10b5b9 /presentation/ui/small-white/iepngfix.htc
parent7da754f80a414810a8c4721e1e4ed9b4c2d706d7 (diff)
rendered workshop presentation
Diffstat (limited to 'presentation/ui/small-white/iepngfix.htc')
-rw-r--r--presentation/ui/small-white/iepngfix.htc42
1 files changed, 42 insertions, 0 deletions
diff --git a/presentation/ui/small-white/iepngfix.htc b/presentation/ui/small-white/iepngfix.htc
new file mode 100644
index 0000000..2a44681
--- /dev/null
+++ b/presentation/ui/small-white/iepngfix.htc
@@ -0,0 +1,42 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="doFix()" />
+
+<script>
+
+// IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull http://www.twinhelix.com
+// Free usage permitted as long as this notice remains intact.
+
+// This must be a path to a blank image. That's all the configuration you need here.
+var blankImg = 'ui/small-white/blank.gif';
+
+var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+
+function filt(s, m) {
+ if (filters[f]) {
+ filters[f].enabled = s ? true : false;
+ if (s) with (filters[f]) { src = s; sizingMethod = m }
+ } else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
+}
+
+function doFix() {
+ if ((parseFloat(navigator.userAgent.match(/MSIE (\S+)/)[1]) < 5.5) ||
+ (event && !/(background|src)/.test(event.propertyName))) return;
+
+ if (tagName == 'IMG') {
+ if ((/\.png$/i).test(src)) {
+ filt(src, 'image'); // was 'scale'
+ src = blankImg;
+ } else if (src.indexOf(blankImg) < 0) filt();
+ } else if (style.backgroundImage) {
+ if (style.backgroundImage.match(/^url[("']+(.*\.png)[)"']+$/i)) {
+ var s = RegExp.$1;
+ style.backgroundImage = '';
+ filt(s, 'crop');
+ } else filt();
+ }
+}
+
+doFix();
+
+</script>
+</public:component> \ No newline at end of file