X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/adapter/yui/ext-yui-adapter.js diff --git a/adapter/yui/ext-yui-adapter.js b/adapter/yui/ext-yui-adapter.js index c95d22e2..c698ac97 100644 --- a/adapter/yui/ext-yui-adapter.js +++ b/adapter/yui/ext-yui-adapter.js @@ -1 +1,7 @@ -Ext={version:"2.2.1"};window["undefined"]=window["undefined"];Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isChrome=ua.indexOf("chrome")>-1,isSafari=!isChrome&&(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isIE8=!isOpera&&ua.indexOf("msie 8")>-1,isGecko=!isSafari&&!isChrome&&ua.indexOf("gecko")>-1,isGecko3=isGecko&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return}var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}if(Ext.isIE&&overrides.toString!=origclass.toString){p.toString=overrides.toString}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i0){return setTimeout(d,c)}d();return 0}});Ext.applyIf(String,{format:function(b){var a=Ext.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});Ext.applyIf(Array.prototype,{indexOf:function(c){for(var b=0,a=this.length;bf?1:-1};Ext.each(c,function(f){e=d(e,f)==1?e:f});return e},mean:function(c){return Ext.sum(c)/c.length},sum:function(c){var d=0;Ext.each(c,function(e){d+=e});return d},partition:function(c,d){var e=[[],[]];Ext.each(c,function(g,h,f){e[(d&&d(g,h,f))||(!d&&g)?0:1].push(g)});return e},invoke:function(c,d){var f=[],e=Array.prototype.slice.call(arguments,2);Ext.each(c,function(g,h){if(g&&typeof g[d]=="function"){f.push(g[d].apply(g,e))}else{f.push(undefined)}});return f},pluck:function(c,e){var d=[];Ext.each(c,function(f){d.push(f[e])});return d},zip:function(){var l=Ext.partition(arguments,function(i){return !Ext.isFunction(i)}),g=l[0],k=l[1][0],c=Ext.max(Ext.pluck(g,"length")),f=[];for(var h=0;h0){for(var p=0;p=3,n={},d=Ext.isGecko?function(p){return Object.prototype.toString.call(p)=="[object XULElement]"}:function(){},a=Ext.isGecko?function(p){try{return p.nodeType==3}catch(q){return false}}:function(p){return p.nodeType==3},g=function(p,r){if(p&&p.firstChild){while(r){if(r===p){return true}try{r=r.parentNode}catch(q){return false}if(r&&(r.nodeType!=1)){r=null}}}return false},k=function(q){var p=Ext.lib.Event.getRelatedTarget(q);return !(d(p)||g(q.currentTarget,p))};Ext.lib.Dom={getViewWidth:function(p){return p?c.getDocumentWidth():c.getViewportWidth()},getViewHeight:function(p){return p?c.getDocumentHeight():c.getViewportHeight()},isAncestor:function(p,q){return c.isAncestor(p,q)},getRegion:function(p){return c.getRegion(p)},getY:function(p){return this.getXY(p)[1]},getX:function(p){return this.getXY(p)[0]},getXY:function(s){var r,w,A,B,v=(document.body||document.documentElement);s=Ext.getDom(s);if(s==v){return[0,0]}if(s.getBoundingClientRect){A=s.getBoundingClientRect();B=i(document).getScroll();return[Math.round(A.left+B.left),Math.round(A.top+B.top)]}var C=0,z=0;r=s;var q=i(s).getStyle("position")=="absolute";while(r){C+=r.offsetLeft;z+=r.offsetTop;if(!q&&i(r).getStyle("position")=="absolute"){q=true}if(Ext.isGecko){w=i(r);var D=parseInt(w.getStyle("borderTopWidth"),10)||0;var t=parseInt(w.getStyle("borderLeftWidth"),10)||0;C+=t;z+=D;if(r!=s&&w.getStyle("overflow")!="visible"){C+=t;z+=D}}r=r.offsetParent}if(Ext.isSafari&&q){C-=v.offsetLeft;z-=v.offsetTop}if(Ext.isGecko&&!q){var u=i(v);C+=parseInt(u.getStyle("borderLeftWidth"),10)||0;z+=parseInt(u.getStyle("borderTopWidth"),10)||0}r=s.parentNode;while(r&&r!=v){if(!Ext.isOpera||(r.tagName!="TR"&&i(r).getStyle("display")!="inline")){C-=r.scrollLeft;z-=r.scrollTop}r=r.parentNode}return[C,z]},setXY:function(p,q){p=Ext.fly(p,"_setXY");p.position();var r=p.translatePoints(q);if(q[0]!==false){p.dom.style.left=r.left+"px"}if(q[1]!==false){p.dom.style.top=r.top+"px"}},setX:function(q,p){this.setXY(q,[p,false])},setY:function(p,q){this.setXY(p,[false,q])}};Ext.lib.Event={getPageX:function(p){return o.getPageX(p.browserEvent||p)},getPageY:function(p){return o.getPageY(p.browserEvent||p)},getXY:function(p){return o.getXY(p.browserEvent||p)},getTarget:function(p){return o.getTarget(p.browserEvent||p)},getRelatedTarget:function(p){return o.getRelatedTarget(p.browserEvent||p)},on:function(t,p,s,r,q){if((p=="mouseenter"||p=="mouseleave")&&!b){var u=n[t.id]||(n[t.id]={});u[p]=s;s=s.createInterceptor(k);p=(p=="mouseenter")?"mouseover":"mouseout"}o.on(t,p,s,r,q)},un:function(r,p,q){if((p=="mouseenter"||p=="mouseleave")&&!b){var t=n[r.id],s=t&&t[p];if(s){q=s.fn;delete t[p];p=(p=="mouseenter")?"mouseover":"mouseout"}}o.removeListener(r,p,q)},purgeElement:function(p){o.purgeElement(p)},preventDefault:function(p){o.preventDefault(p.browserEvent||p)},stopPropagation:function(p){o.stopPropagation(p.browserEvent||p)},stopEvent:function(p){o.stopEvent(p.browserEvent||p)},onAvailable:function(s,r,q,p){return o.onAvailable(s,r,q,p)}};Ext.lib.Ajax={request:function(v,t,p,u,q){if(q){var r=q.headers;if(r){for(var s in r){if(r.hasOwnProperty(s)){h.initHeader(s,r[s],false)}}}if(q.xmlData){if(!r||!r["Content-Type"]){h.initHeader("Content-Type","text/xml",false)}v=(v?v:(q.method?q.method:"POST"));u=q.xmlData}else{if(q.jsonData){if(!r||!r["Content-Type"]){h.initHeader("Content-Type","application/json",false)}v=(v?v:(q.method?q.method:"POST"));u=typeof q.jsonData=="object"?Ext.encode(q.jsonData):q.jsonData}}}return h.asyncRequest(v,t,p,u)},formRequest:function(t,s,q,u,p,r){h.setForm(t,p,r);return h.asyncRequest(Ext.getDom(t).method||"POST",s,q,u)},isCallInProgress:function(p){return h.isCallInProgress(p)},abort:function(p){return h.abort(p)},serializeForm:function(p){var q=h.setForm(p.dom||p);h.resetFormState();return q}};Ext.lib.Region=YAHOO.util.Region;Ext.lib.Point=YAHOO.util.Point;Ext.lib.Anim={scroll:function(s,q,t,u,p,r){this.run(s,q,t,u,p,r,YAHOO.util.Scroll)},motion:function(s,q,t,u,p,r){this.run(s,q,t,u,p,r,YAHOO.util.Motion)},color:function(s,q,t,u,p,r){this.run(s,q,t,u,p,r,YAHOO.util.ColorAnim)},run:function(t,q,v,w,p,s,r){r=r||YAHOO.util.Anim;if(typeof w=="string"){w=YAHOO.util.Easing[w]}var u=new r(t,q,v,w);u.animateX(function(){Ext.callback(p,s)});return u}};function i(p){if(!l){l=new Ext.Element.Flyweight()}l.dom=p;return l}if(Ext.isIE){function f(){var q=Function.prototype;delete q.createSequence;delete q.defer;delete q.createDelegate;delete q.createCallback;delete q.createInterceptor;window.detachEvent("onunload",f)}window.attachEvent("onunload",f)}if(YAHOO.util.Anim){YAHOO.util.Anim.prototype.animateX=function(r,p){var q=function(){this.onComplete.unsubscribe(q);if(typeof r=="function"){r.call(p||this,this)}};this.onComplete.subscribe(q,this,true);this.animate()}}if(YAHOO.util.DragDrop&&Ext.dd.DragDrop){YAHOO.util.DragDrop.defaultPadding=Ext.dd.DragDrop.defaultPadding;YAHOO.util.DragDrop.constrainTo=Ext.dd.DragDrop.constrainTo}YAHOO.util.Dom.getXY=function(p){var q=function(r){return Ext.lib.Dom.getXY(r)};return YAHOO.util.Dom.batch(p,q,YAHOO.util.Dom,true)};if(YAHOO.util.AnimMgr){YAHOO.util.AnimMgr.fps=1000}YAHOO.util.Region.prototype.adjust=function(s,q,p,u){this.top+=s;this.left+=q;this.right+=u;this.bottom+=p;return this};YAHOO.util.Region.prototype.constrainTo=function(p){this.top=this.top.constrain(p.top,p.bottom);this.bottom=this.bottom.constrain(p.top,p.bottom);this.left=this.left.constrain(p.left,p.right);this.right=this.right.constrain(p.left,p.right);return this}})(); \ No newline at end of file