forked from cbsandeep10/IMathAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpngbehavior.htc
More file actions
executable file
·57 lines (45 loc) · 1.56 KB
/
pngbehavior.htc
File metadata and controls
executable file
·57 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<public:component lightWeight="true">
<public:attach event="onpropertychange" onevent="propertyChanged()" />
<public:attach event="onbeforeprint" onevent="beforePrint()" for="window" />
<public:attach event="onafterprint" onevent="afterPrint()" for="window" />
<script>
var supported = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) && navigator.platform == 'Win32';
var realSrc;
var blankSrc = imgBase+'/blank.gif';
var isPrinting = false;
if (supported) fixImage();
function propertyChanged(){
if (!supported || isPrinting) return;
var pName = event.propertyName;
if (pName != 'src') return;
if (!new RegExp(blankSrc).test(src)) fixImage();
};
function fixImage(){
element.runtimeStyle.visibility = 'visible';
element.style.width = element.xwidth?element.xwidth:parseInt(element.width);
element.style.height = element.xheight?element.xheight:parseInt(element.height);
var src = element.src.replace(/%/gi, '%25');
if (src == realSrc && /\.png$/i.test(src)){
element.src = blankSrc;
return;
}
if (!new RegExp(blankSrc).test(src)) realSrc = src;
if (/\.png$/i.test(realSrc)){
element.src = blankSrc;
element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
} else {
element.runtimeStyle.filter = '';
}
}
function beforePrint(){
isPrinting = true;
element.src = realSrc;
element.runtimeStyle.filter = '';
realSrc = null;
}
function afterPrint(){
isPrinting = false;
fixImage();
}
</script>
</public:component>