base-min.js revision 8089142faf9a180758947150b9d6b0992904335f
YUI.add("base-base",function(A){var J=A.Lang;function D(L){this._plugins={};this.after("init",function(O){this._initPlugins(O.cfg);});this.after("destroy",this._destroyPlugins);}D.prototype={plug:function(Q,L){if(Q){if(J.isFunction(Q)){this._plug(Q,L);}else{if(J.isArray(Q)){for(var O=0,P=Q.length;O<P;O++){this.plug(Q[O]);}}else{this._plug(Q.fn,Q.cfg);}}}return this;},unplug:function(O){if(O){this._unplug(O);}else{var L;for(L in this._plugins){if(this._plugins.hasOwnProperty(L)){this._unplug(L);}}}return this;},hasPlugin:function(L){return(this._plugins[L]&&this[L]);},_initPlugins:function(L){var P=this._getClasses(),Q,O;for(O=P.length-1;O>=0;O--){Q=P[O];if(Q.PLUGINS){this.plug(Q.PLUGINS);}}if(L&&L.plugins){this.plug(L.plugins);}},_destroyPlugins:function(){this._unplug();},_plug:function(P,L){if(P&&P.NS){var O=P.NS;L=L||{};L.host=this;if(this.hasPlugin(O)){this[O].setAttrs(L);}else{this[O]=new P(L);this._plugins[O]=P;}}},_unplug:function(P){var O=P,L=this._plugins;if(J.isFunction(P)){O=P.NS;if(O&&(!L[O]||L[O]!==P)){O=null;}}if(O){if(this[O]){this[O].destroy();delete this[O];}if(L[O]){delete L[O];}}}};A.namespace("Plugin").Host=D;var H=A.Object,I=".",F="destroy",N="init",M="initialized",G="destroyed",C="initializer",B=Object.prototype.constructor,K="destructor";function E(){A.Attribute.call(this);this.init.apply(this,arguments);}E.NAME="base";E.ATTRS={initialized:{readOnly:true,value:false},destroyed:{readOnly:true,value:false}};E.prototype={init:function(L){this._yuievt.config.prefix=this.name=this.constructor.NAME;this.publish(N,{queuable:false,defaultFn:this._defInitFn});A.Plugin.Host.call(this);this.fire(N,{cfg:L});return this;},destroy:function(){this.publish(F,{queuable:false,defaultFn:this._defDestroyFn});this.fire(F);return this;},_defInitFn:function(L){this._initHierarchy(L.cfg);this._set(M,true);},_defDestroyFn:function(L){this._destroyHierarchy();this._set(G,true);},_getClasses:function(){if(!this._classes){this._initHierarchyData();}return this._classes;},_getAttrCfgs:function(){if(!this._attrs){this._initHierarchyData();}return this._attrs;},_filterAttrCfgs:function(P,L){var O={};if(P.ATTRS){A.each(P.ATTRS,function(R,Q){if(L[Q]){O[Q]=L[Q];delete L[Q];}});}return O;},_initHierarchyData:function(){var P=this.constructor,O=[],L=[];while(P&&P.prototype){O[O.length]=P;if(P.ATTRS){L[L.length]=P.ATTRS;}P=P.superclass?P.superclass.constructor:null;}this._classes=O;this._attrs=this._aggregateAttrs(L);},_aggregateAttrs:function(R){var L,P,O,U,T,Q,S={};if(R){for(Q=R.length-1;Q>=0;--Q){P=R[Q];for(L in P){if(P.hasOwnProperty(L)){O=A.merge(P[L]);U=O.value;if(U&&!O.useRef&&(B===U.constructor||J.isArray(U))){O.value=A.clone(U);}T=null;if(L.indexOf(I)!==-1){T=L.split(I);L=T.shift();}if(T&&S[L]&&S[L].value){H.setValue(S[L].value,T,U);}else{if(!T){if(!S[L]){S[L]=O;}else{S[L]=A.mix(S[L],O,true);}}}}}}}return S;},_initHierarchy:function(S){var R,L,P,U,Q,O=this._getClasses(),T=this._getAttrCfgs();this._userCfgs=S;for(P=O.length-1;P>=0;P--){R=O[P];L=R.prototype;if(R._yuibuild&&R._yuibuild.exts&&!R._yuibuild.dynamic){for(U=0,Q=R._yuibuild.exts.length;U<Q;U++){R._yuibuild.exts[U].apply(this,arguments);}}this._classCfgs=this._filterAttrCfgs(R,T);this.addAttrs(this._classCfgs,S);this._classCfgs=null;if(L.hasOwnProperty(C)){L[C].apply(this,arguments);}}},_destroyHierarchy:function(){var R,O,Q,L,P=this._getClasses();for(Q=0,L=P.length;Q<L;Q++){R=P[Q];O=R.prototype;if(O.hasOwnProperty(K)){O[K].apply(this,arguments);}}},get:function(O){if(this._classCfgs){var L=O;if(O.indexOf(I)!==-1){var R=L.split(I);L=R.shift();}if(!this.attrAdded(L)&&this._classCfgs[L]){var S=this._classCfgs[L],Q=this._userCfgs,P;if(S){P={};P[L]=S;this.addAttrs(P,Q);}}}return A.Attribute.prototype.get.call(this,O);},toString:function(){return this.constructor.NAME+"["+A.stamp(this)+"]";}};A.mix(E,A.Attribute,false,null,1);A.mix(E,A.Plugin.Host,false,null,1);E.prototype.constructor=E;A.Base=E;},"@VERSION@",{requires:["attribute"]});YUI.add("base-build",function(C){var B=C.Base,A=C.Lang;B._buildCfg={aggregates:["ATTRS","PLUGINS"]};B.build=function(D,I,M,L){var O=B.build,E=O._getClass(I,L),K=O._getAggregates(I,L),G=E._yuibuild.dynamic,J,H,F,N;if(G){if(K){for(J=0,H=K.length;J<H;++J){F=K[J];if(I.hasOwnProperty(F)){E[F]=A.isArray(I[F])?[]:{};}}C.aggregate(E,I,true,K);}}for(J=0,H=M.length;J<H;J++){N=M[J];if(K){C.aggregate(E,N,true,K);}C.mix(E,N,true,null,1);E._yuibuild.exts.push(N);}E.prototype.hasImpl=O._hasImpl;if(G){E.NAME=D;E.prototype.constructor=E;}return E;};C.mix(B.build,{_template:function(D){function E(){E.superclass.constructor.apply(this,arguments);var H=E._yuibuild.exts,F=H.length,G;for(G=0;G<F;G++){H[G].apply(this,arguments);}return this;}C.extend(E,D);return E;},_hasImpl:function(E){if(this.constructor._yuibuild){var G=this.constructor._yuibuild.exts,D=G.length,F;for(F=0;F<D;F++){if(G[F]===E){return true;}}}return false;},_getClass:function(D,E){var F=(E&&false===E.dynamic)?false:true,G=(F)?B.build._template(D):D;G._yuibuild={id:null,exts:[],dynamic:F};return G;},_getAggregates:function(D,E){var F=[],H=(E&&E.aggregates),I=D,G;while(I&&I.prototype){G=I._buildCfg&&I._buildCfg.aggregates;if(G){F=F.concat(G);}I=I.superclass?I.superclass.constructor:null;}if(H){F=F.concat(H);}return F;}});},"@VERSION@",{requires:["base"]});YUI.add("base",function(A){},"@VERSION@",{use:["base-base","base-build"]});