a:30:{s:9:"#provides";s:28:"dijit.layout.StackController";s:9:"#resource";s:25:"layout/StackController.js";s:9:"#requires";a:5:{i:0;a:2:{i:0;s:6:"common";i:1;s:13:"dijit._Widget";}i:1;a:2:{i:0;s:6:"common";i:1;s:16:"dijit._Templated";}i:2;a:2:{i:0;s:6:"common";i:1;s:16:"dijit._Container";}i:3;a:2:{i:0;s:6:"common";i:1;s:23:"dijit.form.ToggleButton";}i:4;a:2:{i:0;s:6:"common";i:1;s:10:"dijit.Menu";}}s:28:"dijit.layout.StackController";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:13:"dijit._Widget";}s:4:"call";a:3:{i:0;s:13:"dijit._Widget";i:1;s:16:"dijit._Templated";i:2;s:16:"dijit._Container";}}s:6:"mixins";a:1:{s:9:"prototype";a:2:{i:0;s:26:"dijit._Templated.prototype";i:1;s:26:"dijit._Container.prototype";}}s:7:"summary";s:47:"Set of buttons to select a page in a page list.";s:11:"description";s:118:"Monitors the specified StackContainer, and whenever a page is added, deleted, or selected, updates itself accordingly.";s:9:"classlike";b:1;}s:43:"dijit.layout.StackController.templateString";a:2:{s:9:"prototype";s:28:"dijit.layout.StackController";s:7:"summary";s:0:"";}s:40:"dijit.layout.StackController.containerId";a:4:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"tags";a:1:{i:0;s:5:"const";}s:4:"type";s:6:"String";s:7:"summary";s:44:"The id of the page container that I point to";}s:41:"dijit.layout.StackController.buttonWidget";a:4:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"tags";a:1:{i:0;s:5:"const";}s:4:"type";s:6:"String";s:7:"summary";s:66:"The name of the button widget to create to correspond to each page";}s:39:"dijit.layout.StackController.postCreate";a:4:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:6:"source";s:751:" dijit.setWaiRole(this.domNode, "tablist"); // TODO: change key from object to id, to get more separation from StackContainer this.pane2button = {}; // mapping from panes to buttons this.pane2handles = {}; // mapping from panes to dojo.connect() handles this.pane2menu = {}; // mapping from panes to close menu this._subscriptions=[ dojo.subscribe(this.containerId+"-startup", this, "onStartup"), dojo.subscribe(this.containerId+"-addChild", this, "onAddChild"), dojo.subscribe(this.containerId+"-removeChild", this, "onRemoveChild"), dojo.subscribe(this.containerId+"-selectChild", this, "onSelectChild"), dojo.subscribe(this.containerId+"-containerKeyPress", this, "onContainerKeyPress") ];";s:7:"summary";s:0:"";}s:38:"dijit.layout.StackController.onStartup";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"info";a:1:{s:4:"type";s:6:"Object";}}s:6:"source";s:94:" dojo.forEach(info.children, this.onAddChild, this); this.onSelectChild(info.selected);";s:7:"summary";s:53:"Called after StackContainer has finished initializing";s:4:"tags";s:7:"private";}s:36:"dijit.layout.StackController.destroy";a:4:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:6:"source";s:163:" for(var pane in this.pane2button){ this.onRemoveChild(pane); } dojo.forEach(this._subscriptions, dojo.unsubscribe); this.inherited(arguments);";s:7:"summary";s:0:"";}s:39:"dijit.layout.StackController.onAddChild";a:5:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"page";a:1:{s:4:"type";s:6:"Widget";}s:11:"insertIndex";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"Integer";}}s:6:"source";s:3980:"dojo.provide("dijit.layout.StackController"); dojo.require("dijit._Widget"); dojo.require("dijit._Templated"); dojo.require("dijit._Container"); dojo.require("dijit.form.ToggleButton"); dojo.require("dijit.Menu"); dojo.requireLocalization("dijit", "common"); dojo.declare( "dijit.layout.StackController", [dijit._Widget, dijit._Templated, dijit._Container], { // summary: // Set of buttons to select a page in a page list. // description: // Monitors the specified StackContainer, and whenever a page is // added, deleted, or selected, updates itself accordingly. templateString: "", // containerId: [const] String // The id of the page container that I point to containerId: "", // buttonWidget: [const] String // The name of the button widget to create to correspond to each page buttonWidget: "dijit.layout._StackButton", postCreate: function(){ dijit.setWaiRole(this.domNode, "tablist"); // TODO: change key from object to id, to get more separation from StackContainer this.pane2button = {}; // mapping from panes to buttons this.pane2handles = {}; // mapping from panes to dojo.connect() handles this.pane2menu = {}; // mapping from panes to close menu this._subscriptions=[ dojo.subscribe(this.containerId+"-startup", this, "onStartup"), dojo.subscribe(this.containerId+"-addChild", this, "onAddChild"), dojo.subscribe(this.containerId+"-removeChild", this, "onRemoveChild"), dojo.subscribe(this.containerId+"-selectChild", this, "onSelectChild"), dojo.subscribe(this.containerId+"-containerKeyPress", this, "onContainerKeyPress") ]; }, onStartup: function(/*Object*/ info){ // summary: // Called after StackContainer has finished initializing // tags: // private dojo.forEach(info.children, this.onAddChild, this); this.onSelectChild(info.selected); }, destroy: function(){ for(var pane in this.pane2button){ this.onRemoveChild(pane); } dojo.forEach(this._subscriptions, dojo.unsubscribe); this.inherited(arguments); }, onAddChild: function(/*Widget*/ page, /*Integer?*/ insertIndex){ // summary: // Called whenever a page is added to the container. // Create button corresponding to the page. // tags: // private // add a node that will be promoted to the button widget var refNode = dojo.doc.createElement("span"); this.domNode.appendChild(refNode); // create an instance of the button widget var cls = dojo.getObject(this.buttonWidget); var button = new cls({label: page.title, closeButton: page.closable}, refNode); this.addChild(button, insertIndex); this.pane2button[page] = button; page.controlButton = button; // this value might be overwritten if two tabs point to same container var handles = []; handles.push(dojo.connect(button, "onClick", dojo.hitch(this,"onButtonClick",page))); if(page.closable){ handles.push(dojo.connect(button, "onClickCloseButton", dojo.hitch(this,"onCloseButtonClick",page))); // add context menu onto title button var _nlsResources = dojo.i18n.getLocalization("dijit", "common"); var closeMenu = new dijit.Menu({targetNodeIds:[button.id], id:button.id+"_Menu"}); var mItem = new dijit.MenuItem({label:_nlsResources.itemClose}); handles.push(dojo.connect(mItem, "onClick", dojo.hitch(this, "onCloseButtonClick", page))); closeMenu.addChild(mItem); this.pane2menu[page] = closeMenu; } this.pane2handles[page] = handles; if(!this._currentChild){ // put the first child into the tab order button.focusNode.setAttribute("tabIndex", "0"); this._currentChild = page; } //make sure all tabs have the same length if(!this.isLeftToRight() && dojo.isIE && this._rectifyRtlTabList){ this._rectifyRtlTabList(); }";s:7:"summary";s:90:"Called whenever a page is added to the container. Create button corresponding to the page.";}s:42:"dijit.layout.StackController.onRemoveChild";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"page";a:1:{s:4:"type";s:6:"Widget";}}s:6:"source";s:449:" if(this._currentChild === page){ this._currentChild = null; } dojo.forEach(this.pane2handles[page], dojo.disconnect); delete this.pane2handles[page]; var menu = this.pane2menu[page]; if (menu){ menu.destroyRecursive(); delete this.pane2menu[page]; } var button = this.pane2button[page]; if(button){ // TODO? if current child { reassign } button.destroy(); delete this.pane2button[page]; }";s:7:"summary";s:98:"Called whenever a page is removed from the container. Remove the button corresponding to the page.";s:4:"tags";s:7:"private";}s:42:"dijit.layout.StackController.onSelectChild";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"page";a:1:{s:4:"type";s:6:"Widget";}}s:6:"source";s:506:" if(!page){ return; } if(this._currentChild){ var oldButton=this.pane2button[this._currentChild]; oldButton.attr('checked', false); oldButton.focusNode.setAttribute("tabIndex", "-1"); } var newButton=this.pane2button[page]; newButton.attr('checked', true); this._currentChild = page; newButton.focusNode.setAttribute("tabIndex", "0"); var container = dijit.byId(this.containerId); dijit.setWaiState(container.containerNode, "labelledby", newButton.id);";s:7:"summary";s:102:"Called when a page has been selected in the StackContainer, either by me or by another StackController";s:4:"tags";s:7:"private";}s:42:"dijit.layout.StackController.onButtonClick";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"page";a:1:{s:4:"type";s:6:"Widget";}}s:6:"source";s:112:" var container = dijit.byId(this.containerId); // TODO: do this via topics? container.selectChild(page); ";s:7:"summary";s:81:"Called whenever one of my child buttons is pressed in an attempt to select a page";s:4:"tags";s:7:"private";}s:47:"dijit.layout.StackController.onCloseButtonClick";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"page";a:1:{s:4:"type";s:6:"Widget";}}s:6:"source";s:192:" var container = dijit.byId(this.containerId); container.closeChild(page); var b = this.pane2button[this._currentChild]; if(b){ dijit.focus(b.focusNode || b.domNode); }";s:7:"summary";s:84:"Called whenever one of my child buttons [X] is pressed in an attempt to close a page";s:4:"tags";s:7:"private";}s:37:"dijit.layout.StackController.adjacent";a:7:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"forward";a:1:{s:4:"type";s:7:"Boolean";}}s:6:"source";s:454:" if(!this.isLeftToRight() && (!this.tabPosition || /top|bottom/.test(this.tabPosition))){ forward = !forward; } // find currently focused button in children array var children = this.getChildren(); var current = dojo.indexOf(children, this.pane2button[this._currentChild]); // pick next button to focus on var offset = forward ? 1 : children.length - 1; return children[ (current + offset) % children.length ]; // dijit._Widget";s:7:"summary";s:50:"Helper for onkeypress to find next/previous button";s:4:"tags";s:7:"private";s:7:"returns";s:13:"dijit._Widget";}s:39:"dijit.layout.StackController.onkeypress";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:1196:" if(this.disabled || e.altKey ){ return; } var forward = null; if(e.ctrlKey || !e._djpage){ var k = dojo.keys; switch(e.charOrCode){ case k.LEFT_ARROW: case k.UP_ARROW: if(!e._djpage){ forward = false; } break; case k.PAGE_UP: if(e.ctrlKey){ forward = false; } break; case k.RIGHT_ARROW: case k.DOWN_ARROW: if(!e._djpage){ forward = true; } break; case k.PAGE_DOWN: if(e.ctrlKey){ forward = true; } break; case k.DELETE: if(this._currentChild.closable){ this.onCloseButtonClick(this._currentChild); } dojo.stopEvent(e); break; default: if(e.ctrlKey){ if(e.charOrCode === k.TAB){ this.adjacent(!e.shiftKey).onClick(); dojo.stopEvent(e); }else if(e.charOrCode == "w"){ if(this._currentChild.closable){ this.onCloseButtonClick(this._currentChild); } dojo.stopEvent(e); // avoid browser tab closing. } } } // handle page navigation if(forward !== null){ this.adjacent(forward).onClick(); dojo.stopEvent(e); } }";s:7:"summary";s:127:"Handle keystrokes on the page list, for advancing to next/previous button and closing the current page if the page is closable.";s:4:"tags";s:7:"private";}s:48:"dijit.layout.StackController.onContainerKeyPress";a:6:{s:9:"prototype";s:28:"dijit.layout.StackController";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"info";a:1:{s:4:"type";s:6:"Object";}}s:6:"source";s:60:" info.e._djpage = info.page; this.onkeypress(info.e);";s:7:"summary";s:49:"Called when there was a keypress on the container";s:4:"tags";s:7:"private";}s:40:"dijit.layout.StackController.pane2button";a:2:{s:8:"instance";s:28:"dijit.layout.StackController";s:7:"summary";s:0:"";}s:41:"dijit.layout.StackController.pane2handles";a:2:{s:8:"instance";s:28:"dijit.layout.StackController";s:7:"summary";s:0:"";}s:38:"dijit.layout.StackController.pane2menu";a:2:{s:8:"instance";s:28:"dijit.layout.StackController";s:7:"summary";s:0:"";}s:43:"dijit.layout.StackController._subscriptions";a:3:{s:8:"instance";s:28:"dijit.layout.StackController";s:7:"private";b:1;s:7:"summary";s:0:"";}s:42:"dijit.layout.StackController._currentChild";a:3:{s:8:"instance";s:28:"dijit.layout.StackController";s:7:"private";b:1;s:7:"summary";s:0:"";}s:25:"dijit.layout._StackButton";a:4:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:23:"dijit.form.ToggleButton";}s:4:"call";a:1:{i:0;s:23:"dijit.form.ToggleButton";}}s:7:"summary";s:39:"Internal widget used by StackContainer.";s:9:"classlike";b:1;}s:34:"dijit.layout._StackButton.tabIndex";a:2:{s:9:"prototype";s:25:"dijit.layout._StackButton";s:7:"summary";s:0:"";}s:36:"dijit.layout._StackButton.postCreate";a:5:{s:9:"prototype";s:25:"dijit.layout._StackButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:91:" dijit.setWaiRole((this.focusNode || this.domNode), "tab"); this.inherited(arguments);";s:7:"summary";s:0:"";}s:33:"dijit.layout._StackButton.onClick";a:5:{s:9:"prototype";s:25:"dijit.layout._StackButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:106:" dijit.focus(this.focusNode); // ... now let StackController catch the event and tell me what to do";s:7:"summary";s:200:"This is for TabContainer where the tabs are <span> rather than button, so need to set focus explicitly (on some browsers) Note that you shouldn't override this method, but you can connect to it.";}s:44:"dijit.layout._StackButton.onClickCloseButton";a:5:{s:9:"prototype";s:25:"dijit.layout._StackButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:25:" evt.stopPropagation();";s:7:"summary";s:197:"StackContainer connects to this function; if your widget contains a close button then clicking it should call this function. Note that you shouldn't override this method, but you can connect to it.";}s:12:"dijit.layout";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dijit";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}