📄 ext-base.js
字号:
(function(){var _1;Ext.lib.Dom={getViewWidth:function(_2){return _2?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(_3){return _3?this.getDocumentHeight():this.getViewportHeight();},getDocumentHeight:function(){var _4=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(_4,this.getViewportHeight());},getDocumentWidth:function(){var _5=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(_5,this.getViewportWidth());},getViewportHeight:function(){var _6=self.innerHeight;var _7=document.compatMode;if((_7||Ext.isIE)&&!Ext.isOpera){_6=(_7=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return _6;},getViewportWidth:function(){var _8=self.innerWidth;var _9=document.compatMode;if(_9||Ext.isIE){_8=(_9=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;}return _8;},isAncestor:function(p,c){p=Ext.getDom(p);c=Ext.getDom(c);if(!p||!c){return false;}if(p.contains&&!Ext.isSafari){return p.contains(c);}else{if(p.compareDocumentPosition){return!!(p.compareDocumentPosition(c)&16);}else{var _c=c.parentNode;while(_c){if(_c==p){return true;}else{if(!_c.tagName||_c.tagName.toUpperCase()=="HTML"){return false;}}_c=_c.parentNode;}return false;}}},getRegion:function(el){return Ext.lib.Region.getRegion(el);},getY:function(el){return this.getXY(el)[1];},getX:function(el){return this.getXY(el)[0];},getXY:function(el){var p,pe,b,_14,bd=document.body;el=Ext.getDom(el);if(el.getBoundingClientRect){b=el.getBoundingClientRect();_14=fly(document).getScroll();return[b.left+_14.left,b.top+_14.top];}else{var x=el.offsetLeft,y=el.offsetTop;p=el.offsetParent;var _18=false;if(p!=el){while(p){x+=p.offsetLeft;y+=p.offsetTop;if(Ext.isSafari&&!_18&&fly(p).getStyle("position")=="absolute"){_18=true;}if(Ext.isGecko){pe=fly(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle("overflow")!="visible"){x+=bl;y+=bt;}}p=p.offsetParent;}}if(Ext.isSafari&&(_18||fly(el).getStyle("position")=="absolute")){x-=bd.offsetLeft;y-=bd.offsetTop;}}p=el.offsetParent;while(p&&p!=bd){if(!Ext.isOpera||(Ext.isOpera&&p.tagName!="TR"&&fly(p).getStyle("display")!="inline")){x-=p.scrollLeft;y-=p.scrollTop;}if(Ext.isGecko){pe=fly(p);if(pe.getStyle("overflow")!="visible"){x+=parseInt(pe.getStyle("borderLeftWidth"),10)||0;y+=parseInt(pe.getStyle("borderTopWidth"),10)||0;}}p=p.parentNode;}return[x,y];},setXY:function(el,xy){el=Ext.fly(el,"_setXY");el.position();var pts=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=pts.left+"px";}if(xy[1]!==false){el.dom.style.top=pts.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);},setY:function(el,y){this.setXY(el,[false,y]);}};Ext.lib.Event=function(){var _22=false;var _23=[];var _24=[];var _25=0;var _26=[];var _27=0;var _28=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var _29=this;var _2a=function(){_29._tryPreloadAttach();};this._interval=setInterval(_2a,this.POLL_INTERVAL);}},onAvailable:function(_2b,_2c,_2d,_2e){_26.push({id:_2b,fn:_2c,obj:_2d,override:_2e,checkReady:false});_25=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_30,fn){el=Ext.getDom(el);if(!el||!fn){return false;}if("unload"==_30){_24[_24.length]=[el,_30,fn];return true;}var _32=function(e){return fn(Ext.lib.Event.getEvent(e));};var li=[el,_30,fn,_32];var _35=_23.length;_23[_35]=li;this.doAdd(el,_30,_32,false);return true;},removeListener:function(el,_37,fn){var i,len;el=Ext.getDom(el);if(!fn){return this.purgeElement(el,false,_37);}if("unload"==_37){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_37&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _3c=null;var _3d=arguments[3];if("undefined"==typeof _3d){_3d=this._getCacheIndex(el,_37,fn);}if(_3d>=0){_3c=_23[_3d];}if(!el||!_3c){return false;}this.doRemove(el,_37,_3c[this.WFN],false);delete _23[_3d][this.WFN];delete _23[_3d][this.FN];_23.splice(_3d,1);return true;},getTarget:function(ev,_3f){ev=ev.browserEvent||ev;var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_41){if(Ext.isSafari&&_41&&3==_41.nodeType){return _41.parentNode;}else{return _41;}},getPageX:function(ev){ev=ev.browserEvent||ev;var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(Ext.isIE){x+=this.getScroll()[1];}}return x;},getPageY:function(ev){ev=ev.browserEvent||ev;var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(Ext.isIE){y+=this.getScroll()[0];}}return y;},getXY:function(ev){ev=ev.browserEvent||ev;return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);},getTime:function(ev){ev=ev.browserEvent||ev;if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){ev=ev.browserEvent||ev;if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){ev=ev.browserEvent||ev;if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){ev=ev.browserEvent||ev;return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,_53,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_53){return i;}}return-1;},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){_22=true;var EU=Ext.lib.Event;if(Ext.isIE){EU.doRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _5b=!_22;if(!_5b){_5b=(_25>0);}var _5c=[];for(var i=0,len=_26.length;i<len;++i){var _5f=_26[i];if(_5f){var el=this.getEl(_5f.id);if(el){if(!_5f.checkReady||_22||el.nextSibling||(document&&document.body)){var _61=el;if(_5f.override){if(_5f.override===true){_61=_5f.obj;}else{_61=_5f.override;}}_5f.fn.call(_61,_5f.obj);_26[i]=null;}}else{_5c.push(_5f);}}}_25=(_5c.length===0)?0:_25-1;if(_5b){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_63,_64){var _65=this.getListeners(el,_64);if(_65){for(var i=0,len=_65.length;i<len;++i){var l=_65[i];this.removeListener(el,l.type,l.fn);}}if(_63&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_63,_64);}}},getListeners:function(el,_6a){var _6b=[],_6c;if(!_6a){_6c=[_23,_24];}else{if(_6a=="unload"){_6c=[_24];}else{_6c=[_23];}}for(var j=0;j<_6c.length;++j){var _6e=_6c[j];if(_6e&&_6e.length>0){for(var i=0,len=_6e.length;i<len;++i){var l=_6e[i];if(l&&l[this.EL]===el&&(!_6a||_6a===l[this.TYPE])){_6b.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}return(_6b.length)?_6b:null;},_unload:function(e){var EU=Ext.lib.Event,i,j,l,len,_78;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _79=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_79=l[EU.OBJ];}else{_79=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_79,EU.getEvent(e),l[EU.OBJ]);_24[i]=null;l=null;_79=null;}}_24=null;if(_23&&_23.length>0){j=_23.length;while(j){_78=j-1;l=_23[_78];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],_78);}j=j-1;}l=null;EU.clearCache();}EU.doRemove(window,"unload",EU._unload);},getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else{if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}}},doAdd:function(){if(window.addEventListener){return function(el,_7d,fn,_7f){el.addEventListener(_7d,fn,(_7f));};}else{if(window.attachEvent){return function(el,_81,fn,_83){el.attachEvent("on"+_81,fn);};}else{return function(){};}}}(),doRemove:function(){if(window.removeEventListener){return function(el,_85,fn,_87){el.removeEventListener(_85,fn,(_87));};}else{if(window.detachEvent){return function(el,_89,fn){el.detachEvent("on"+_89,fn);};}else{return function(){};}}}()};}();Ext.lib.Event.on=Ext.lib.Event.addListener;Ext.lib.Event.un=Ext.lib.Event.removeListener;Ext.lib.Ajax={request:function(_8b,uri,cb,_8e,_8f){if(_8f){var hs=_8f.headers;if(hs){for(var h in hs){if(hs.hasOwnProperty(h)){this.initHeader(h,hs[h],false);}}}if(_8f.xmlData){this.initHeader("Content-Type","text/xml",false);_8b="POST";_8e=_8f.xmlData;}}return this.asyncRequest(_8b,uri,cb,_8e);},serializeForm:function(_92){if(typeof _92=="string"){_92=(document.getElementById(_92)||document.forms[_92]);}var el,_94,val,_96,_97="",_98=false;for(var i=0;i<_92.elements.length;i++){el=_92.elements[i];_96=_92.elements[i].disabled;_94=_92.elements[i].name;val=_92.elements[i].value;if(!_96&&_94){switch(el.type){case"select-one":case"select-multiple":for(var j=0;j<el.options.length;j++){if(el.options[j].selected){if(Ext.isIE){_97+=encodeURIComponent(_94)+"="+encodeURIComponent(el.options[j].attributes["value"].specified?el.options[j].value:el.options[j].text)+"&";}else{_97+=encodeURIComponent(_94)+"="+encodeURIComponent(el.options[j].hasAttribute("value")?el.options[j].value:el.options[j].text)+"&";}}}break;case"radio":case"checkbox":if(el.checked){_97+=encodeURIComponent(_94)+"="+encodeURIComponent(val)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(_98==false){_97+=encodeURIComponent(_94)+"="+encodeURIComponent(val)+"&";_98=true;}break;default:_97+=encodeURIComponent(_94)+"="+encodeURIComponent(val)+"&";break;}}}_97=_97.substr(0,_97.length-1);return _97;},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(id){this.activeX.unshift(id);},setDefaultPostHeader:function(b){this.useDefaultHeader=b;},setDefaultXhrHeader:function(b){this.useDefaultXhrHeader=b;},setPollingInterval:function(i){if(typeof i=="number"&&isFinite(i)){this.pollInterval=i;}},createXhrObject:function(_9f){var obj,_a1;try{_a1=new XMLHttpRequest();obj={conn:_a1,tId:_9f};}catch(e){for(var i=0;i<this.activeX.length;++i){try{_a1=new ActiveXObject(this.activeX[i]);obj={conn:_a1,tId:_9f};break;}catch(e){}}}finally{return obj;}},getConnectionObject:function(){var o;var tId=this.transactionId;try{o=this.createXhrObject(tId);if(o){this.transactionId++;}}catch(e){}finally{return o;}},asyncRequest:function(_a5,uri,_a7,_a8){var o=this.getConnectionObject();if(!o){return null;}else{o.conn.open(_a5,uri,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true);}}if(_a8&&this.useDefaultHeader){this.initHeader("Content-Type",this.defaultPostHeader);}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(o);}this.handleReadyState(o,_a7);o.conn.send(_a8||null);return o;}},handleReadyState:function(o,_ab){var _ac=this;if(_ab&&_ab.timeout){this.timeout[o.tId]=window.setTimeout(function(){_ac.abort(o,_ab,true);},_ab.timeout);}this.poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(_ac.poll[o.tId]);delete _ac.poll[o.tId];if(_ab&&_ab.timeout){delete _ac.timeout[o.tId];}_ac.handleTransactionResponse(o,_ab);}},this.pollInterval);},handleTransactionResponse:function(o,_ae,_af){if(!_ae){this.releaseObject(o);return;}var _b0,_b1;try{if(o.conn.status!==undefined&&o.conn.status!=0){_b0=o.conn.status;}else{_b0=13030;}}catch(e){_b0=13030;}if(_b0>=200&&_b0<300){_b1=this.createResponseObject(o,_ae.argument);if(_ae.success){if(!_ae.scope){_ae.success(_b1);}else{_ae.success.apply(_ae.scope,[_b1]);}}}else{switch(_b0){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:_b1=this.createExceptionObject(o.tId,_ae.argument,(_af?_af:false));if(_ae.failure){if(!_ae.scope){_ae.failure(_b1);}else{_ae.failure.apply(_ae.scope,[_b1]);}}break;default:_b1=this.createResponseObject(o,_ae.argument);if(_ae.failure){if(!_ae.scope){_ae.failure(_b1);}else{_ae.failure.apply(_ae.scope,[_b1]);}}}}this.releaseObject(o);_b1=null;},createResponseObject:function(o,_b3){var obj={};var _b5={};try{var _b6=o.conn.getAllResponseHeaders();var _b7=_b6.split("\n");for(var i=0;i<_b7.length;i++){var _b9=_b7[i].indexOf(":");if(_b9!=-1){_b5[_b7[i].substring(0,_b9)]=_b7[i].substring(_b9+2);}}}catch(e){}obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=_b5;obj.getAllResponseHeaders=_b6;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof _b3!==undefined){obj.argument=_b3;}return obj;},createExceptionObject:function(tId,_bb,_bc){var _bd=0;var _be="communication failure";var _bf=-1;var _c0="transaction aborted";var obj={};obj.tId=tId;if(_bc){obj.status=_bf;obj.statusText=_c0;}else{obj.status=_bd;obj.statusText=_be;}if(_bb){obj.argument=_bb;}return obj;},initHeader:function(_c2,_c3,_c4){var _c5=(_c4)?this.defaultHeaders:this.headers;if(_c5[_c2]===undefined){_c5[_c2]=_c3;}else{_c5[_c2]=_c3+","+_c5[_c2];}if(_c4){this.hasDefaultHeaders=true;}else{this.hasHeaders=true;}},setHeader:function(o){if(this.hasDefaultHeaders){for(var _c7 in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(_c7)){o.conn.setRequestHeader(_c7,this.defaultHeaders[_c7]);}}}if(this.hasHeaders){for(var _c7 in this.headers){if(this.headers.hasOwnProperty(_c7)){o.conn.setRequestHeader(_c7,this.headers[_c7]);}}this.headers={};this.hasHeaders=false;}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false;},abort:function(o,_c9,_ca){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this.poll[o.tId]);delete this.poll[o.tId];if(_ca){delete this.timeout[o.tId];}this.handleTransactionResponse(o,_c9,true);return true;}else{return false;}},isCallInProgress:function(o){if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}else{return false;}},releaseObject:function(o){o.conn=null;o=null;},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};Ext.lib.Region.prototype={contains:function(_d1){return(_d1.left>=this.left&&_d1.right<=this.right&&_d1.top>=this.top&&_d1.bottom<=this.bottom);},getArea:function(){return((this.bottom-this.top)*(this.right-this.left));},intersect:function(_d2){var t=Math.max(this.top,_d2.top);var r=Math.min(this.right,_d2.right);var b=Math.min(this.bottom,_d2.bottom);var l=Math.max(this.left,_d2.left);if(b>=t&&r>=l){return new Ext.lib.Region(t,r,b,l);}else{return null;}},union:function(_d7){var t=Math.min(this.top,_d7.top);var r=Math.max(this.right,_d7.right);var b=Math.max(this.bottom,_d7.bottom);var l=Math.min(this.left,_d7.left);return new Ext.lib.Region(t,r,b,l);},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;}};Ext.lib.Region.getRegion=function(el){var p=Ext.lib.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Ext.lib.Region(t,r,b,l);};Ext.lib.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(el,_e9,_ea,_eb,cb,_ed){this.run(el,_e9,_ea,_eb,cb,_ed,Ext.lib.Scroll);},motion:function(el,_ef,_f0,_f1,cb,_f3){this.run(el,_ef,_f0,_f1,cb,_f3,Ext.lib.Motion);},color:function(el,_f5,_f6,_f7,cb,_f9){this.run(el,_f5,_f6,_f7,cb,_f9,Ext.lib.ColorAnim);},run:function(el,_fb,_fc,_fd,cb,_ff,type){type=type||Ext.lib.AnimBase;if(typeof _fd=="string"){_fd=Ext.lib.Easing[_fd];}var anim=new type(el,_fb,_fc,_fd);anim.animateX(function(){Ext.callback(cb,_ff);});return anim;}};function fly(el){if(!_1){_1=new Ext.Element.Flyweight();}_1.dom=el;return _1;}if(Ext.isIE){function fnCleaup(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("unload",fnCleaup);}window.attachEvent("unload",fnCleaup);}Ext.lib.AnimBase=function(el,_105,_106,_107){if(el){this.init(el,_105,_106,_107);}};Ext.lib.AnimBase.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,_10b,end){return this.method(this.currentFrame,_10b,end-_10b,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}Ext.fly(this.getEl(),"_anim").setStyle(attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=fly(el).getStyle(attr);if(val!=="auto"&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(fly(el).getStyle("position")=="absolute"&&pos)){val=el["offset"+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return"px";}return"";},animateX:function(_117,_118){var f=function(){this.onComplete.removeListener(f);if(typeof _117=="function"){_117.call(_118||this,this);}};this.onComplete.addListener(f,this);this.animate();},setRuntimeAttribute:function(attr){var _11b;var end;var _11d=this.attributes;this.runtimeAttributes[attr]={};var _11e=function(prop){return(typeof prop!=="undefined");};if(!_11e(_11d[attr]["to"])&&!_11e(_11d[attr]["by"])){return false;}_11b=(_11e(_11d[attr]["from"]))?_11d[attr]["from"]:this.getAttribute(attr);if(_11e(_11d[attr]["to"])){end=_11d[attr]["to"];}else{if(_11e(_11d[attr]["by"])){if(_11b.constructor==Array){end=[];for(var i=0,len=_11b.length;i<len;++i){end[i]=_11b[i]+_11d[attr]["by"][i];}}else{end=_11b+_11d[attr]["by"];}}}this.runtimeAttributes[attr].start=_11b;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(_11e(_11d[attr].unit))?_11d[attr]["unit"]:this.getDefaultUnit(attr);},init:function(el,_123,_124,_125){var _126=false;var _127=null;var _128=0;el=Ext.getDom(el);this.attributes=_123||{};this.duration=_124||1;this.method=_125||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return _126;};this.getStartTime=function(){return _127;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this);};this.stop=function(_129){if(_129){this.currentFrame=this.totalFrames;this._onTween.fire();}Ext.lib.AnimMgr.stop(this);};var _12a=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}_126=true;_128=0;_127=new Date();};var _12c=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return("duration: "+data.duration+", currentFrame: "+data.currentFrame);};this.onTween.fire(data);var _12e=this.runtimeAttributes;for(var attr in _12e){this.setAttribute(attr,this.doMethod(attr,_12e[attr].start,_12e[attr].end),_12e[attr].unit);}_128+=1;};var _130=function(){var _131=(new Date()-_127)/1000;var data={duration:_131,frames:_128,fps:_128/_131};data.toString=function(){return("duration: "+data.duration+", frames: "+data.frames+", fps: "+data.fps);};_126=false;_128=0;this.onComplete.fire(data);};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(_12a);this._onTween.addListener(_12c);this._onComplete.addListener(_130);}};Ext.lib.AnimMgr=new function(){var _133=null;var _134=[];var _135=0;this.fps=1000;this.delay=1;this.registerElement=function(_136){_134[_134.length]=_136;_135+=1;_136._onStart.fire();this.start();};this.unRegister=function(_137,_138){_137._onComplete.fire();_138=_138||_139(_137);if(_138!=-1){_134.splice(_138,1);}_135-=1;if(_135<=0){this.stop();}};this.start=function(){if(_133===null){_133=setInterval(this.run,this.delay);}};this.stop=function(_13a){if(!_13a){clearInterval(_133);for(var i=0,len=_134.length;i<len;++i){if(_134[0].isAnimated()){this.unRegister(_134[0],0);}}_134=[];_133=null;_135=0;}else{this.unRegister(_13a);}};this.run=function(){for(var i=0,len=_134.length;i<len;++i){var _13f=_134[i];if(!_13f||!_13f.isAnimated()){continue;}if(_13f.currentFrame<_13f.totalFrames||_13f.totalFrames===null){_13f.currentFrame+=1;if(_13f.useSeconds){_140(_13f);}_13f._onTween.fire();}else{Ext.lib.AnimMgr.stop(_13f,i);}}};var _139=function(anim){for(var i=0,len=_134.length;i<len;++i){if(_134[i]==anim){return i;}}return-1;};var _140=function(_144){var _145=_144.totalFrames;var _146=_144.currentFrame;var _147=(_144.currentFrame*_144.duration*1000/_144.totalFrames);var _148=(new Date()-_144.getStartTime());var _149=0;if(_148<_144.duration*1000){_149=Math.round((_148/_147-1)*_144.currentFrame);}else{_149=_145-(_146+1);}if(_149>0&&isFinite(_149)){if(_144.currentFrame+_149>=_145){_149=_145-(_146+1);}_144.currentFrame+=_149;}};};Ext.lib.Bezier=new function(){this.getPosition=function(_14a,t){var n=_14a.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[_14a[i][0],_14a[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};(function(){Ext.lib.ColorAnim=function(el,_151,_152,_153){Ext.lib.ColorAnim.superclass.constructor.call(this,el,_151,_152,_153);};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var Y=Ext.lib;var _155=Y.ColorAnim.superclass;var _156=Y.ColorAnim.prototype;_156.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};_156.patterns.color=/color$/i;_156.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;_156.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;_156.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;_156.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;_156.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};_156.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=fly(el).getStyle(attr);if(this.patterns.transparent.test(val)){var _15e=el.parentNode;val=fly(_15e).getStyle(attr);while(_15e&&this.patterns.transparent.test(val)){_15e=_15e.parentNode;val=fly(_15e).getStyle(attr);if(_15e.tagName.toUpperCase()=="HTML"){val="#fff";}}}}else{val=_155.getAttribute.call(this,attr);}return val;};_156.doMethod=function(attr,_160,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=_160.length;i<len;++i){val[i]=_155.doMethod.call(this,attr,_160[i],end[i]);}val="rgb("+Math.floor(val[0])+","+Math.floor(val[1])+","+Math.floor(val[2])+")";}else{val=_155.doMethod.call(this,attr,_160,end);}return val;};_156.setRuntimeAttribute=function(attr){_155.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var _166=this.attributes;var _167=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof _166[attr]["to"]==="undefined"&&typeof _166[attr]["by"]!=="undefined"){end=this.parseColor(_166[attr].by);for(var i=0,len=_167.length;i<len;++i){end[i]=_167[i]+end[i];}}this.runtimeAttributes[attr].start=_167;this.runtimeAttributes[attr].end=end;}};})();Ext.lib.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return-0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-Ext.lib.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}}}return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return Ext.lib.Easing.bounceIn(t*2,0,c,d)*0.5+b;}return Ext.lib.Easing.bounceOut(t*2-d,0,c,d)*0.5+c*0.5+b;}};(function(){Ext.lib.Motion=function(el,_1b8,_1b9,_1ba){if(el){Ext.lib.Motion.superclass.constructor.call(this,el,_1b8,_1b9,_1ba);}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var Y=Ext.lib;var _1bc=Y.Motion.superclass;var _1bd=Y.Motion.prototype;_1bd.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};_1bd.patterns.points=/^points$/i;_1bd.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||"px";_1bc.setAttribute.call(this,"left",val[0],unit);_1bc.setAttribute.call(this,"top",val[1],unit);}else{_1bc.setAttribute.call(this,attr,val,unit);}};_1bd.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[_1bc.getAttribute.call(this,"left"),_1bc.getAttribute.call(this,"top")];}else{val=_1bc.getAttribute.call(this,attr);}return val;};_1bd.doMethod=function(attr,_1c6,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=_1bc.doMethod.call(this,attr,_1c6,end);}return val;};_1bd.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var _1cc=this.attributes;var _1cd;var _1ce=_1cc["points"]["control"]||[];var end;var i,len;if(_1ce.length>0&&!(_1ce[0]instanceof Array)){_1ce=[_1ce];}else{var tmp=[];for(i=0,len=_1ce.length;i<len;++i){tmp[i]=_1ce[i];}_1ce=tmp;}Ext.fly(el).position();if(_1d3(_1cc["points"]["from"])){Ext.lib.Dom.setXY(el,_1cc["points"]["from"]);}else{Ext.lib.Dom.setXY(el,Ext.lib.Dom.getXY(el));}_1cd=this.getAttribute("points");if(_1d3(_1cc["points"]["to"])){end=_1d4.call(this,_1cc["points"]["to"],_1cd);var _1d5=Ext.lib.Dom.getXY(this.getEl());for(i=0,len=_1ce.length;i<len;++i){_1ce[i]=_1d4.call(this,_1ce[i],_1cd);}}else{if(_1d3(_1cc["points"]["by"])){end=[_1cd[0]+_1cc["points"]["by"][0],_1cd[1]+_1cc["points"]["by"][1]];for(i=0,len=_1ce.length;i<len;++i){_1ce[i]=[_1cd[0]+_1ce[i][0],_1cd[1]+_1ce[i][1]];}}}this.runtimeAttributes[attr]=[_1cd];if(_1ce.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(_1ce);}this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}else{_1bc.setRuntimeAttribute.call(this,attr);}};var _1d4=function(val,_1d7){var _1d8=Ext.lib.Dom.getXY(this.getEl());val=[val[0]-_1d8[0]+_1d7[0],val[1]-_1d8[1]+_1d7[1]];return val;};var _1d3=function(prop){return(typeof prop!=="undefined");};})();(function(){Ext.lib.Scroll=function(el,_1db,_1dc,_1dd){if(el){Ext.lib.Scroll.superclass.constructor.call(this,el,_1db,_1dc,_1dd);}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var Y=Ext.lib;var _1df=Y.Scroll.superclass;var _1e0=Y.Scroll.prototype;_1e0.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};_1e0.doMethod=function(attr,_1e4,end){var val=null;if(attr=="scroll"){val=[this.method(this.currentFrame,_1e4[0],end[0]-_1e4[0],this.totalFrames),this.method(this.currentFrame,_1e4[1],end[1]-_1e4[1],this.totalFrames)];}else{val=_1df.doMethod.call(this,attr,_1e4,end);}return val;};_1e0.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=="scroll"){val=[el.scrollLeft,el.scrollTop];}else{val=_1df.getAttribute.call(this,attr);}return val;};_1e0.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=="scroll"){el.scrollLeft=val[0];el.scrollTop=val[1];}else{_1df.setAttribute.call(this,attr,val,unit);}};})();})();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -