Mercurial > hg > dbtune-site
annotate onto/talks/mo-ismir-2007/ui/default/iepngfix.htc @ 19:1e79ce3ff5f5 tip
Simplify and cut some non-working resource paths
author | Chris Cannam |
---|---|
date | Wed, 08 Nov 2017 15:27:23 +0000 |
parents | 1e44d666ced1 |
children |
rev | line source |
---|---|
Chris@0 | 1 <public:component> |
Chris@0 | 2 <public:attach event="onpropertychange" onevent="doFix()" /> |
Chris@0 | 3 |
Chris@0 | 4 <script> |
Chris@0 | 5 |
Chris@0 | 6 // IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull http://www.twinhelix.com |
Chris@0 | 7 // Free usage permitted as long as this notice remains intact. |
Chris@0 | 8 |
Chris@0 | 9 // This must be a path to a blank image. That's all the configuration you need here. |
Chris@0 | 10 var blankImg = 'v11rc1/default/blank.gif'; |
Chris@0 | 11 |
Chris@0 | 12 var f = 'DXImageTransform.Microsoft.AlphaImageLoader'; |
Chris@0 | 13 |
Chris@0 | 14 function filt(s, m) { |
Chris@0 | 15 if (filters[f]) { |
Chris@0 | 16 filters[f].enabled = s ? true : false; |
Chris@0 | 17 if (s) with (filters[f]) { src = s; sizingMethod = m } |
Chris@0 | 18 } else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")'; |
Chris@0 | 19 } |
Chris@0 | 20 |
Chris@0 | 21 function doFix() { |
Chris@0 | 22 if ((parseFloat(navigator.userAgent.match(/MSIE (\S+)/)[1]) < 5.5) || |
Chris@0 | 23 (event && !/(background|src)/.test(event.propertyName))) return; |
Chris@0 | 24 |
Chris@0 | 25 if (tagName == 'IMG') { |
Chris@0 | 26 if ((/\.png$/i).test(src)) { |
Chris@0 | 27 filt(src, 'image'); // was 'scale' |
Chris@0 | 28 src = blankImg; |
Chris@0 | 29 } else if (src.indexOf(blankImg) < 0) filt(); |
Chris@0 | 30 } else if (style.backgroundImage) { |
Chris@0 | 31 if (style.backgroundImage.match(/^url[("']+(.*\.png)[)"']+$/i)) { |
Chris@0 | 32 var s = RegExp.$1; |
Chris@0 | 33 style.backgroundImage = ''; |
Chris@0 | 34 filt(s, 'crop'); |
Chris@0 | 35 } else filt(); |
Chris@0 | 36 } |
Chris@0 | 37 } |
Chris@0 | 38 |
Chris@0 | 39 doFix(); |
Chris@0 | 40 |
Chris@0 | 41 </script> |
Chris@0 | 42 </public:component> |