]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/yui/yui-base-min.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / yui / yui-base-min.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 if(typeof YUI!="undefined"){YUI._YUI=YUI;}var YUI=function(){var c=0,f=this,b=arguments,a=b.length,e=function(h,g){return(h&&h.hasOwnProperty&&(h instanceof g));},d=(typeof YUI_config!=="undefined")&&YUI_config;if(!(e(f,YUI))){f=new YUI();}else{f._init();if(YUI.GlobalConfig){f.applyConfig(YUI.GlobalConfig);}if(d){f.applyConfig(d);}if(!a){f._setup();}}if(a){for(;c<a;c++){f.applyConfig(b[c]);}f._setup();}f.instanceOf=e;return f;};(function(){var p,b,q="3.3.0",h=".",n="http://yui.yahooapis.com/",t="yui3-js-enabled",l=function(){},g=Array.prototype.slice,r={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},f=(typeof window!="undefined"),e=(f)?window:null,v=(f)?e.document:null,d=v&&v.documentElement,a=d&&d.className,c={},i=new Date().getTime(),m=function(z,y,x,w){if(z&&z.addEventListener){z.addEventListener(y,x,w);}else{if(z&&z.attachEvent){z.attachEvent("on"+y,x);}}},u=function(A,z,y,w){if(A&&A.removeEventListener){try{A.removeEventListener(z,y,w);}catch(x){}}else{if(A&&A.detachEvent){A.detachEvent("on"+z,y);}}},s=function(){YUI.Env.windowLoaded=true;YUI.Env.DOMReady=true;if(f){u(window,"load",s);}},j=function(y,x){var w=y.Env._loader;if(w){w.ignoreRegistered=false;w.onEnd=null;w.data=null;w.required=[];w.loadType=null;}else{w=new y.Loader(y.config);y.Env._loader=w;}return w;},o=function(y,x){for(var w in x){if(x.hasOwnProperty(w)){y[w]=x[w];}}},k={success:true};if(d&&a.indexOf(t)==-1){if(a){a+=" ";}a+=t;d.className=a;}if(q.indexOf("@")>-1){q="3.2.0";}p={applyConfig:function(D){D=D||l;var y,A,z=this.config,B=z.modules,x=z.groups,C=z.rls,w=this.Env._loader;for(A in D){if(D.hasOwnProperty(A)){y=D[A];if(B&&A=="modules"){o(B,y);}else{if(x&&A=="groups"){o(x,y);}else{if(C&&A=="rls"){o(C,y);}else{if(A=="win"){z[A]=y.contentWindow||y;z.doc=z[A].document;}else{if(A=="_yuid"){}else{z[A]=y;}}}}}}}if(w){w._config(D);}},_config:function(w){this.applyConfig(w);},_init:function(){var y,z=this,w=YUI.Env,x=z.Env,A;z.version=q;if(!x){z.Env={mods:{},versions:{},base:n,cdn:n+q+"/build/",_idx:0,_used:{},_attached:{},_yidx:0,_uidx:0,_guidp:"y",_loaded:{},serviced:{},getBase:w&&w.getBase||function(G,F){var B,C,E,H,D;C=(v&&v.getElementsByTagName("script"))||[];for(E=0;E<C.length;E=E+1){H=C[E].src;if(H){D=H.match(G);B=D&&D[1];if(B){y=D[2];if(y){D=y.indexOf("js");if(D>-1){y=y.substr(0,D);}}D=H.match(F);if(D&&D[3]){B=D[1]+D[3];}break;}}}return B||x.cdn;}};x=z.Env;x._loaded[q]={};if(w&&z!==YUI){x._yidx=++w._yidx;x._guidp=("yui_"+q+"_"+x._yidx+"_"+i).replace(/\./g,"_");}else{if(YUI._YUI){w=YUI._YUI.Env;x._yidx+=w._yidx;x._uidx+=w._uidx;for(A in w){if(!(A in x)){x[A]=w[A];}}delete YUI._YUI;}}z.id=z.stamp(z);c[z.id]=z;}z.constructor=YUI;z.config=z.config||{win:e,doc:v,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,cacheUse:true,fetchCSS:true};z.config.base=YUI.config.base||z.Env.getBase(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/,/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);if(!y||(!("-min.-debug.").indexOf(y))){y="-min.";}z.config.loaderPath=YUI.config.loaderPath||"loader/loader"+(y||"-min.")+"js";},_setup:function(B){var x,A=this,w=[],z=YUI.Env.mods,y=A.config.core||["get","rls","intl-base","loader","yui-log","yui-later","yui-throttle"];for(x=0;x<y.length;x++){if(z[y[x]]){w.push(y[x]);}}A._attach(["yui-base"]);A._attach(w);},applyTo:function(C,B,y){if(!(B in r)){this.log(B+": applyTo not allowed","warn","yui");return null;}var x=c[C],A,w,z;if(x){A=B.split(".");w=x;for(z=0;z<A.length;z=z+1){w=w[A[z]];if(!w){this.log("applyTo not found: "+B,"warn","yui");}}return w.apply(x,y);}return null;},add:function(x,C,B,w){w=w||{};var A=YUI.Env,D={name:x,fn:C,version:B,details:w},E,z,y=A.versions;A.mods[x]=D;y[B]=y[B]||{};y[B][x]=D;for(z in c){if(c.hasOwnProperty(z)){E=c[z].Env._loader;if(E){if(!E.moduleInfo[x]){E.addModule(w,x);}}}}return this;},_attach:function(w,C){var F,A,J,x,I,y,z,L=YUI.Env.mods,B=this,E,D=B.Env._attached,G=w.length,K;for(F=0;F<G;F++){if(!D[w[F]]){A=w[F];J=L[A];if(!J){K=B.Env._loader;if(!K||!K.moduleInfo[A]){B.message("NOT loaded: "+A,"warn","yui");}}else{D[A]=true;x=J.details;I=x.requires;y=x.use;z=x.after;if(I){for(E=0;E<I.length;E++){if(!D[I[E]]){if(!B._attach(I)){return false;}break;}}}if(z){for(E=0;E<z.length;E++){if(!D[z[E]]){if(!B._attach(z)){return false;}break;}}}if(y){for(E=0;E<y.length;E++){if(!D[y[E]]){if(!B._attach(y)){return false;}break;}}}if(J.fn){try{J.fn(B,A);}catch(H){B.error("Attach error: "+A,H,A);return false;}}}}}return true;},use:function(){var w=g.call(arguments,0),z=w[w.length-1],y=this,x;if(y.Lang.isFunction(z)){w.pop();}else{z=null;}if(y._loading){y._useQueue=y._useQueue||new y.Queue();y._useQueue.add([w,z]);}else{x=w.join();if(y.config.cacheUse&&y.Env.serviced[x]){y._notify(z,k,w);}else{y._use(w,function(B,A){if(B.config.cacheUse){B.Env.serviced[x]=true;}B._notify(z,A,w);});}}return y;},_notify:function(z,w,x){if(!w.success&&this.config.loadErrorFn){this.config.loadErrorFn.call(this,this,z,w,x);}else{if(z){try{z(this,w);}catch(y){this.error("use callback error",y,x);}}}},_use:function(y,A){if(!this.Array){this._attach(["yui-base"]);}var L,F,M,x=this,N=YUI.Env,z=N.mods,w=x.Env,C=w._used,J=N._loaderQueue,Q=y[0],E=x.Array,O=x.config,D=O.bootstrap,K=[],H=[],P=true,B=O.fetchCSS,I=function(S,R){if(!S.length){return;}E.each(S,function(V){if(!R){H.push(V);}if(C[V]){return;}var T=z[V],W,U;if(T){C[V]=true;W=T.details.requires;U=T.details.use;}else{if(!N._loaded[q][V]){K.push(V);}else{C[V]=true;}}if(W&&W.length){I(W);}if(U&&U.length){I(U,1);}});},G=function(V){var T=V||{success:true,msg:"not dynamic"},S,R,U=true,W=T.data;x._loading=false;if(W){R=K;K=[];H=[];I(W);S=K.length;if(S){if(K.sort().join()==R.sort().join()){S=false;}}}if(S&&W){x._loading=false;x._use(y,function(){if(x._attach(W)){x._notify(A,T,W);}});}else{if(W){U=x._attach(W);}if(U){x._notify(A,T,y);}}if(x._useQueue&&x._useQueue.size()&&!x._loading){x._use.apply(x,x._useQueue.next());}};if(Q==="*"){P=x._attach(x.Object.keys(z));if(P){G();}return x;}if(D&&x.Loader&&y.length){F=j(x);F.require(y);F.ignoreRegistered=true;
9 F.calculate(null,(B)?null:"js");y=F.sorted;}I(y);L=K.length;if(L){K=x.Object.keys(E.hash(K));L=K.length;}if(D&&L&&x.Loader){x._loading=true;F=j(x);F.onEnd=G;F.context=x;F.data=y;F.ignoreRegistered=false;F.require(y);F.insert(null,(B)?null:"js");}else{if(L&&x.config.use_rls){x.Get.script(x._rls(y),{onEnd:function(R){G(R);},data:y});}else{if(D&&L&&x.Get&&!w.bootstrapped){x._loading=true;M=function(){x._loading=false;J.running=false;w.bootstrapped=true;if(x._attach(["loader"])){x._use(y,A);}};if(N._bootstrapping){J.add(M);}else{N._bootstrapping=true;x.Get.script(O.base+O.loaderPath,{onEnd:M});}}else{P=x._attach(y);if(P){G();}}}}return x;},namespace:function(){var x=arguments,B=this,z=0,y,A,w;for(;z<x.length;z++){w=x[z];if(w.indexOf(h)){A=w.split(h);for(y=(A[0]=="YAHOO")?1:0;y<A.length;y++){B[A[y]]=B[A[y]]||{};B=B[A[y]];}}else{B[w]=B[w]||{};}}return B;},log:l,message:l,error:function(A,y,x){var z=this,w;if(z.config.errorFn){w=z.config.errorFn.apply(z,arguments);}if(z.config.throwFail&&!w){throw (y||new Error(A));}else{z.message(A,"error");}return z;},guid:function(w){var x=this.Env._guidp+(++this.Env._uidx);return(w)?(w+x):x;},stamp:function(y,z){var w;if(!y){return y;}if(y.uniqueID&&y.nodeType&&y.nodeType!==9){w=y.uniqueID;}else{w=(typeof y==="string")?y:y._yuid;}if(!w){w=this.guid();if(!z){try{y._yuid=w;}catch(x){w=null;}}}return w;},destroy:function(){var w=this;if(w.Event){w.Event._unload();}delete c[w.id];delete w.Env;delete w.config;}};YUI.prototype=p;for(b in p){if(p.hasOwnProperty(b)){YUI[b]=p[b];}}YUI._init();if(f){m(window,"load",s);}else{s();}YUI.Env.add=m;YUI.Env.remove=u;if(typeof exports=="object"){exports.YUI=YUI;}}());YUI.add("yui-base",function(c){c.Lang=c.Lang||{};var k=c.Lang,B="array",p="boolean",f="date",g="error",i="function",t="number",A="null",n="object",y="regexp",r="string",s=String.prototype,m=Object.prototype.toString,D="undefined",b={"undefined":D,"number":t,"boolean":p,"string":r,"[object Function]":i,"[object RegExp]":y,"[object Array]":B,"[object Date]":f,"[object Error]":g},x=/^\s+|\s+$/g,z="",e=/\{\s*([^\|\}]+?)\s*(?:\|([^\}]*))?\s*\}/g;k.isArray=function(E){return k.type(E)===B;};k.isBoolean=function(E){return typeof E===p;};k.isFunction=function(E){return k.type(E)===i;};k.isDate=function(E){return k.type(E)===f&&E.toString()!=="Invalid Date"&&!isNaN(E);};k.isNull=function(E){return E===null;};k.isNumber=function(E){return typeof E===t&&isFinite(E);};k.isObject=function(G,F){var E=typeof G;return(G&&(E===n||(!F&&(E===i||k.isFunction(G)))))||false;};k.isString=function(E){return typeof E===r;};k.isUndefined=function(E){return typeof E===D;};k.trim=s.trim?function(E){return(E&&E.trim)?E.trim():E;}:function(E){try{return E.replace(x,z);}catch(F){return E;}};k.trimLeft=s.trimLeft?function(E){return E.trimLeft();}:function(E){return E.replace(/^\s+/,"");};k.trimRight=s.trimRight?function(E){return E.trimRight();}:function(E){return E.replace(/\s+$/,"");};k.isValue=function(F){var E=k.type(F);switch(E){case t:return isFinite(F);case A:case D:return false;default:return !!(E);}};k.type=function(E){return b[typeof E]||b[m.call(E)]||(E?n:A);};k.sub=function(E,F){return((E.replace)?E.replace(e,function(G,H){return(!k.isUndefined(F[H]))?F[H]:G;}):E);};k.now=Date.now||function(){return new Date().getTime();};var u=Array.prototype,w="length",l=function(K,I,G){var H=(G)?2:l.test(K),F,E,L=I||0;if(H){try{return u.slice.call(K,L);}catch(J){E=[];F=K.length;for(;L<F;L++){E.push(K[L]);}return E;}}else{return[K];}};c.Array=l;l.test=function(G){var E=0;if(c.Lang.isObject(G)){if(c.Lang.isArray(G)){E=1;}else{try{if((w in G)&&!G.tagName&&!G.alert&&!G.apply){E=2;}}catch(F){}}}return E;};l.each=(u.forEach)?function(E,F,G){u.forEach.call(E||[],F,G||c);return c;}:function(F,H,I){var E=(F&&F.length)||0,G;for(G=0;G<E;G=G+1){H.call(I||c,F[G],G,F);}return c;};l.hash=function(G,F){var J={},E=G.length,I=F&&F.length,H;for(H=0;H<E;H=H+1){J[G[H]]=(I&&I>H)?F[H]:true;}return J;};l.indexOf=(u.indexOf)?function(E,F){return u.indexOf.call(E,F);}:function(E,G){for(var F=0;F<E.length;F=F+1){if(E[F]===G){return F;}}return -1;};l.numericSort=function(F,E){return(F-E);};l.some=(u.some)?function(E,F,G){return u.some.call(E,F,G);}:function(F,H,I){var E=F.length,G;for(G=0;G<E;G=G+1){if(H.call(I,F[G],G,F)){return true;}}return false;};function C(){this._init();this.add.apply(this,arguments);}C.prototype={_init:function(){this._q=[];},next:function(){return this._q.shift();},last:function(){return this._q.pop();},add:function(){this._q.push.apply(this._q,arguments);return this;},size:function(){return this._q.length;}};c.Queue=C;YUI.Env._loaderQueue=YUI.Env._loaderQueue||new C();var o="__",a=function(G,F){var E=F.toString;if(c.Lang.isFunction(E)&&E!=Object.prototype.toString){G.toString=E;}};c.merge=function(){var F=arguments,H={},G,E=F.length;for(G=0;G<E;G=G+1){c.mix(H,F[G],true);}return H;};c.mix=function(E,N,G,M,J,L){if(!N||!E){return E||c;}if(J){switch(J){case 1:return c.mix(E.prototype,N.prototype,G,M,0,L);case 2:c.mix(E.prototype,N.prototype,G,M,0,L);break;case 3:return c.mix(E,N.prototype,G,M,0,L);case 4:return c.mix(E.prototype,N,G,M,0,L);default:}}var I,H,F,K;if(M&&M.length){for(I=0,H=M.length;I<H;++I){F=M[I];K=c.Lang.type(E[F]);if(N.hasOwnProperty(F)){if(L&&K=="object"){c.mix(E[F],N[F]);}else{if(G||!(F in E)){E[F]=N[F];}}}}}else{for(I in N){if(N.hasOwnProperty(I)){if(L&&c.Lang.isObject(E[I],true)){c.mix(E[I],N[I],G,M,0,true);}else{if(G||!(I in E)){E[I]=N[I];}}}}if(c.UA.ie){a(E,N);}}return E;};c.cached=function(G,E,F){E=E||{};return function(I){var H=(arguments.length>1)?Array.prototype.join.call(arguments,o):I;if(!(H in E)||(F&&E[H]==F)){E[H]=G.apply(G,arguments);}return E[H];};};var q=function(){},h=function(E){q.prototype=E;return new q();},j=function(F,E){return F&&F.hasOwnProperty&&F.hasOwnProperty(E);},v,d=function(I,H){var G=(H===2),E=(G)?0:[],F;for(F in I){if(j(I,F)){if(G){E++;}else{E.push((H)?I[F]:F);}}}return E;};c.Object=h;h.keys=function(E){return d(E);};h.values=function(E){return d(E,1);
10 };h.size=Object.size||function(E){return d(E,2);};h.hasKey=j;h.hasValue=function(F,E){return(c.Array.indexOf(h.values(F),E)>-1);};h.owns=j;h.each=function(I,H,J,G){var F=J||c,E;for(E in I){if(G||j(I,E)){H.call(F,I[E],E,I);}}return c;};h.some=function(I,H,J,G){var F=J||c,E;for(E in I){if(G||j(I,E)){if(H.call(F,I[E],E,I)){return true;}}}return false;};h.getValue=function(I,H){if(!c.Lang.isObject(I)){return v;}var F,G=c.Array(H),E=G.length;for(F=0;I!==v&&F<E;F++){I=I[G[F]];}return I;};h.setValue=function(K,I,J){var E,H=c.Array(I),G=H.length-1,F=K;if(G>=0){for(E=0;F!==v&&E<G;E++){F=F[H[E]];}if(F!==v){F[H[E]]=J;}else{return v;}}return K;};h.isEmpty=function(F){for(var E in F){if(j(F,E)){return false;}}return true;};YUI.Env.parseUA=function(K){var J=function(N){var O=0;return parseFloat(N.replace(/\./g,function(){return(O++==1)?"":".";}));},M=c.config.win,E=M&&M.navigator,H={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:E&&E.cajaVersion,secure:false,os:null},F=K||E&&E.userAgent,L=M&&M.location,G=L&&L.href,I;H.secure=G&&(G.toLowerCase().indexOf("https")===0);if(F){if((/windows|win32/i).test(F)){H.os="windows";}else{if((/macintosh/i).test(F)){H.os="macintosh";}else{if((/rhino/i).test(F)){H.os="rhino";}}}if((/KHTML/).test(F)){H.webkit=1;}I=F.match(/AppleWebKit\/([^\s]*)/);if(I&&I[1]){H.webkit=J(I[1]);if(/ Mobile\//.test(F)){H.mobile="Apple";I=F.match(/OS ([^\s]*)/);if(I&&I[1]){I=J(I[1].replace("_","."));}H.ios=I;H.ipad=H.ipod=H.iphone=0;I=F.match(/iPad|iPod|iPhone/);if(I&&I[0]){H[I[0].toLowerCase()]=H.ios;}}else{I=F.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(I){H.mobile=I[0];}if(/webOS/.test(F)){H.mobile="WebOS";I=F.match(/webOS\/([^\s]*);/);if(I&&I[1]){H.webos=J(I[1]);}}if(/ Android/.test(F)){H.mobile="Android";I=F.match(/Android ([^\s]*);/);if(I&&I[1]){H.android=J(I[1]);}}}I=F.match(/Chrome\/([^\s]*)/);if(I&&I[1]){H.chrome=J(I[1]);}else{I=F.match(/AdobeAIR\/([^\s]*)/);if(I){H.air=I[0];}}}if(!H.webkit){I=F.match(/Opera[\s\/]([^\s]*)/);if(I&&I[1]){H.opera=J(I[1]);I=F.match(/Opera Mini[^;]*/);if(I){H.mobile=I[0];}}else{I=F.match(/MSIE\s([^;]*)/);if(I&&I[1]){H.ie=J(I[1]);}else{I=F.match(/Gecko\/([^\s]*)/);if(I){H.gecko=1;I=F.match(/rv:([^\s\)]*)/);if(I&&I[1]){H.gecko=J(I[1]);}}}}}}YUI.Env.UA=H;return H;};c.UA=YUI.Env.UA||YUI.Env.parseUA();},"3.3.0");