]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dijit/layout/StackContainer.js
lib: Upgrade Dojo and Dijit from 1.8.3 to 1.12.1
[tt-rss.git] / lib / dijit / layout / StackContainer.js
index 78a49021df4094e92183dea5d1e9f2f4f0e6013d..621a941e1384886e621bd5d20de6b911e4eb33a6 100644 (file)
@@ -1,148 +1,2 @@
-/*
-       Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
-       Available via Academic Free License >= 2.1 OR the modified BSD license.
-       see: http://dojotoolkit.org/license for details
-*/
-
-
-if(!dojo._hasResource["dijit.layout.StackContainer"]){
-dojo._hasResource["dijit.layout.StackContainer"]=true;
-dojo.provide("dijit.layout.StackContainer");
-dojo.require("dijit._Templated");
-dojo.require("dijit.layout._LayoutWidget");
-dojo.requireLocalization("dijit","common",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
-dojo.require("dojo.cookie");
-dojo.declare("dijit.layout.StackContainer",dijit.layout._LayoutWidget,{doLayout:true,persist:false,baseClass:"dijitStackContainer",postCreate:function(){
-this.inherited(arguments);
-dojo.addClass(this.domNode,"dijitLayoutContainer");
-dijit.setWaiRole(this.containerNode,"tabpanel");
-this.connect(this.domNode,"onkeypress",this._onKeyPress);
-},startup:function(){
-if(this._started){
-return;
-}
-var _1=this.getChildren();
-dojo.forEach(_1,this._setupChild,this);
-if(this.persist){
-this.selectedChildWidget=dijit.byId(dojo.cookie(this.id+"_selectedChild"));
-}else{
-dojo.some(_1,function(_2){
-if(_2.selected){
-this.selectedChildWidget=_2;
-}
-return _2.selected;
-},this);
-}
-var _3=this.selectedChildWidget;
-if(!_3&&_1[0]){
-_3=this.selectedChildWidget=_1[0];
-_3.selected=true;
-}
-dojo.publish(this.id+"-startup",[{children:_1,selected:_3}]);
-this.inherited(arguments);
-},resize:function(){
-var _4=this.selectedChildWidget;
-if(_4&&!this._hasBeenShown){
-this._hasBeenShown=true;
-this._showChild(_4);
-}
-this.inherited(arguments);
-},_setupChild:function(_5){
-this.inherited(arguments);
-dojo.removeClass(_5.domNode,"dijitVisible");
-dojo.addClass(_5.domNode,"dijitHidden");
-_5.domNode.title="";
-},addChild:function(_6,_7){
-this.inherited(arguments);
-if(this._started){
-dojo.publish(this.id+"-addChild",[_6,_7]);
-this.layout();
-if(!this.selectedChildWidget){
-this.selectChild(_6);
-}
-}
-},removeChild:function(_8){
-this.inherited(arguments);
-if(this._started){
-dojo.publish(this.id+"-removeChild",[_8]);
-}
-if(this._beingDestroyed){
-return;
-}
-if(this.selectedChildWidget===_8){
-this.selectedChildWidget=undefined;
-if(this._started){
-var _9=this.getChildren();
-if(_9.length){
-this.selectChild(_9[0]);
-}
-}
-}
-if(this._started){
-this.layout();
-}
-},selectChild:function(_a,_b){
-_a=dijit.byId(_a);
-if(this.selectedChildWidget!=_a){
-this._transition(_a,this.selectedChildWidget,_b);
-this.selectedChildWidget=_a;
-dojo.publish(this.id+"-selectChild",[_a]);
-if(this.persist){
-dojo.cookie(this.id+"_selectedChild",this.selectedChildWidget.id);
-}
-}
-},_transition:function(_c,_d){
-if(_d){
-this._hideChild(_d);
-}
-this._showChild(_c);
-if(_c.resize){
-if(this.doLayout){
-_c.resize(this._containerContentBox||this._contentBox);
-}else{
-_c.resize();
-}
-}
-},_adjacent:function(_e){
-var _f=this.getChildren();
-var _10=dojo.indexOf(_f,this.selectedChildWidget);
-_10+=_e?1:_f.length-1;
-return _f[_10%_f.length];
-},forward:function(){
-this.selectChild(this._adjacent(true),true);
-},back:function(){
-this.selectChild(this._adjacent(false),true);
-},_onKeyPress:function(e){
-dojo.publish(this.id+"-containerKeyPress",[{e:e,page:this}]);
-},layout:function(){
-if(this.doLayout&&this.selectedChildWidget&&this.selectedChildWidget.resize){
-this.selectedChildWidget.resize(this._containerContentBox||this._contentBox);
-}
-},_showChild:function(_11){
-var _12=this.getChildren();
-_11.isFirstChild=(_11==_12[0]);
-_11.isLastChild=(_11==_12[_12.length-1]);
-_11.selected=true;
-dojo.removeClass(_11.domNode,"dijitHidden");
-dojo.addClass(_11.domNode,"dijitVisible");
-_11._onShow();
-},_hideChild:function(_13){
-_13.selected=false;
-dojo.removeClass(_13.domNode,"dijitVisible");
-dojo.addClass(_13.domNode,"dijitHidden");
-_13.onHide();
-},closeChild:function(_14){
-var _15=_14.onClose(this,_14);
-if(_15){
-this.removeChild(_14);
-_14.destroyRecursive();
-}
-},destroyDescendants:function(_16){
-dojo.forEach(this.getChildren(),function(_17){
-this.removeChild(_17);
-_17.destroyRecursive(_16);
-},this);
-}});
-dojo.require("dijit.layout.StackController");
-dojo.extend(dijit._Widget,{selected:false,closable:false,iconClass:"",showTitle:true});
-}
+//>>built
+define("dijit/layout/StackContainer",["dojo/_base/array","dojo/cookie","dojo/_base/declare","dojo/dom-class","dojo/dom-construct","dojo/has","dojo/_base/lang","dojo/on","dojo/ready","dojo/topic","dojo/when","../registry","../_WidgetBase","./_LayoutWidget"],function(_1,_2,_3,_4,_5,_6,_7,on,_8,_9,_a,_b,_c,_d){if(_6("dijit-legacy-requires")){_8(0,function(){var _e=["dijit/layout/StackController"];require(_e);});}var _f=_3("dijit.layout.StackContainer",_d,{doLayout:true,persist:false,baseClass:"dijitStackContainer",buildRendering:function(){this.inherited(arguments);_4.add(this.domNode,"dijitLayoutContainer");},postCreate:function(){this.inherited(arguments);this.own(on(this.domNode,"keydown",_7.hitch(this,"_onKeyDown")));},startup:function(){if(this._started){return;}var _10=this.getChildren();_1.forEach(_10,this._setupChild,this);if(this.persist){this.selectedChildWidget=_b.byId(_2(this.id+"_selectedChild"));}else{_1.some(_10,function(_11){if(_11.selected){this.selectedChildWidget=_11;}return _11.selected;},this);}var _12=this.selectedChildWidget;if(!_12&&_10[0]){_12=this.selectedChildWidget=_10[0];_12.selected=true;}_9.publish(this.id+"-startup",{children:_10,selected:_12,textDir:this.textDir});this.inherited(arguments);},resize:function(){if(!this._hasBeenShown){this._hasBeenShown=true;var _13=this.selectedChildWidget;if(_13){this._showChild(_13);}}this.inherited(arguments);},_setupChild:function(_14){var _15=_14.domNode,_16=_5.place("<div role='tabpanel' class='"+this.baseClass+"ChildWrapper dijitHidden'>",_14.domNode,"replace"),_17=_14["aria-label"]||_14.title||_14.label;if(_17){_16.setAttribute("aria-label",_17);}_5.place(_15,_16);_14._wrapper=_16;this.inherited(arguments);if(_15.style.display=="none"){_15.style.display="block";}_14.domNode.removeAttribute("title");},addChild:function(_18,_19){this.inherited(arguments);if(this._started){_9.publish(this.id+"-addChild",_18,_19);this.layout();if(!this.selectedChildWidget){this.selectChild(_18);}}},removeChild:function(_1a){var idx=_1.indexOf(this.getChildren(),_1a);this.inherited(arguments);_5.destroy(_1a._wrapper);delete _1a._wrapper;if(this._started){_9.publish(this.id+"-removeChild",_1a);}if(this._descendantsBeingDestroyed){return;}if(this.selectedChildWidget===_1a){this.selectedChildWidget=undefined;if(this._started){var _1b=this.getChildren();if(_1b.length){this.selectChild(_1b[Math.max(idx-1,0)]);}}}if(this._started){this.layout();}},selectChild:function(_1c,_1d){var d;_1c=_b.byId(_1c);if(this.selectedChildWidget!=_1c){d=this._transition(_1c,this.selectedChildWidget,_1d);this._set("selectedChildWidget",_1c);_9.publish(this.id+"-selectChild",_1c,this._focused);if(this.persist){_2(this.id+"_selectedChild",this.selectedChildWidget.id);}}return _a(d||true);},_transition:function(_1e,_1f){if(_1f){this._hideChild(_1f);}var d=this._showChild(_1e);if(_1e.resize){if(this.doLayout){_1e.resize(this._containerContentBox||this._contentBox);}else{_1e.resize();}}return d;},_adjacent:function(_20){var _21=this.getChildren();var _22=_1.indexOf(_21,this.selectedChildWidget);_22+=_20?1:_21.length-1;return _21[_22%_21.length];},forward:function(){return this.selectChild(this._adjacent(true),true);},back:function(){return this.selectChild(this._adjacent(false),true);},_onKeyDown:function(e){_9.publish(this.id+"-containerKeyDown",{e:e,page:this});},layout:function(){var _23=this.selectedChildWidget;if(_23&&_23.resize){if(this.doLayout){_23.resize(this._containerContentBox||this._contentBox);}else{_23.resize();}}},_showChild:function(_24){var _25=this.getChildren();_24.isFirstChild=(_24==_25[0]);_24.isLastChild=(_24==_25[_25.length-1]);_24._set("selected",true);if(_24._wrapper){_4.replace(_24._wrapper,"dijitVisible","dijitHidden");}return (_24._onShow&&_24._onShow())||true;},_hideChild:function(_26){_26._set("selected",false);if(_26._wrapper){_4.replace(_26._wrapper,"dijitHidden","dijitVisible");}_26.onHide&&_26.onHide();},closeChild:function(_27){var _28=!_27.onClose||_27.onClose(this,_27);if(_28){this.removeChild(_27);_27.destroyRecursive();}},destroyDescendants:function(_29){this._descendantsBeingDestroyed=true;this.selectedChildWidget=undefined;_1.forEach(this.getChildren(),function(_2a){if(!_29){this.removeChild(_2a);}_2a.destroyRecursive(_29);},this);this._descendantsBeingDestroyed=false;}});_f.ChildWidgetProperties={selected:false,disabled:false,closable:false,iconClass:"dijitNoIcon",showTitle:true};_7.extend(_c,_f.ChildWidgetProperties);return _f;});
\ No newline at end of file