app-base-min.js revision 643b587df86f154722e5eec69dc648fecada33ca
YUI.add("app-base",function(b){var a=b.Lang;b.App=b.Base.create("app",b.Base,[b.Router,b.PjaxBase,b.View],{views:{},transitions:{},initializer:function(c){c||(c={});this.views=c.views?b.merge(this.views,c.views):this.views;this.transitions=c.transitions?b.merge(this.transitions,c.transitions):this.transitions;this._viewInfoMap={};this.after("activeViewChange",this._afterActiveViewChange);},getViewInfo:function(c){if(c instanceof b.View){return this._viewInfoMap[b.stamp(c,true)];}return this.views[c];},createView:function(f,e){var d=this.getViewInfo(f),g=d&&d.type,h=a.isString(g)?b[g]:g,c;if(a.isFunction(h)){c=new h(e).render();this._viewInfoMap[b.stamp(c,true)]=d;}return c;},showView:function(c,f,e){var d;if(a.isString(c)){d=this.getViewInfo(c)||{};c=d.instance||this.createView(c,f);}a.isFunction(e)&&(e={callback:e});return this._set("activeView",c,e);},_transitionViews:function(f,c,d,e){f&&f.get("container").appendTo(this.get("container"));e&&e.call(this);},_attachView:function(c){var d;if(c){c.addTarget(this);d=this.getViewInfo(c);d&&(d.instance=c);}},_detachView:function(c){if(!c){return;}var d=this.getViewInfo(c)||{};if(d.preserve){c.remove();}else{c.destroy();delete this._viewInfoMap[b.stamp(c,true)];if(c===d.instance){delete d.instance;}}c.removeTarget(this);},_afterActiveViewChange:function(d){var h=d.newVal,c=d.prevVal,g=d.callback,f=d.transition;if(h===c){return g&&g.call(this,h);}this._transitionViews(h,c,f,function(){this._detachView(c);this._attachView(h);g&&g.call(this,h);});}},{ATTRS:{container:{value:b.one("body")},linkSelector:{value:"a"},activeView:{readOnly:true}}});},"@VERSION@",{requires:["controller","pjax-base","view","transition"]});