a:70:{s:9:"#provides";s:17:"dijit.form.Button";s:9:"#resource";s:14:"form/Button.js";s:9:"#requires";a:2:{i:0;a:2:{i:0;s:6:"common";i:1;s:22:"dijit.form._FormWidget";}i:1;a:2:{i:0;s:6:"common";i:1;s:16:"dijit._Container";}}s:17:"dijit.form.Button";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:22:"dijit.form._FormWidget";}s:4:"call";a:1:{i:0;s:22:"dijit.form._FormWidget";}}s:7:"summary";s:75:"Basically the same thing as a normal HTML button, but with special styling.";s:11:"description";s:164:"Buttons can display a label, an icon, or both.
A label should always be specified (through innerHTML) or the label
attribute. It can be hidden via showLabel=false.";s:8:"examples";a:2:{i:0;s:74:"
";i:1;s:120:"
var button1 = new dijit.form.Button({label: "hello world", onClick: foo});
dojo.body().appendChild(button1.domNode);";}s:9:"classlike";b:1;}s:23:"dijit.form.Button.label";a:3:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:4:"HTML";s:7:"summary";s:163:"String
Text to display in button.
If the label is hidden (showLabel=false) then and no title has
been specified, then label is also set as title attribute of icon.";}s:27:"dijit.form.Button.showLabel";a:4:{s:9:"prototype";s:17:"dijit.form.Button";s:8:"instance";s:17:"dijit.form.Button";s:4:"type";s:7:"Boolean";s:7:"summary";s:371:"Set this to true to hide the label text and display only the icon.
(If showLabel=false then iconClass must be specified.)
Especially useful for toolbars.
If showLabel=true, the label will become the title (a.k.a. tooltip/hint) of the icon.
The exception case is for computers in high-contrast mode, where the label
will still be displayed, since the icon doesn't appear.";}s:27:"dijit.form.Button.iconClass";a:3:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:6:"String";s:7:"summary";s:58:"Class to apply to div in button to make it display an icon";}s:22:"dijit.form.Button.type";a:4:{s:9:"prototype";s:17:"dijit.form.Button";s:8:"instance";s:17:"dijit.form.Button";s:4:"type";s:6:"String";s:7:"summary";s:90:"Defines the type of button. "button", "submit", or "reset".";}s:27:"dijit.form.Button.baseClass";a:2:{s:9:"prototype";s:17:"dijit.form.Button";s:7:"summary";s:0:"";}s:30:"dijit.form.Button.templatePath";a:2:{s:9:"prototype";s:17:"dijit.form.Button";s:7:"summary";s:0:"";}s:30:"dijit.form.Button.attributeMap";a:2:{s:9:"prototype";s:17:"dijit.form.Button";s:7:"summary";s:0:"";}s:26:"dijit.form.Button._onClick";a:7:{s:9:"prototype";s:17:"dijit.form.Button";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:149:" if(this.disabled || this.readOnly){
return false;
}
this._clicked(); // widget click actions
return this.onClick(e); // user click actions";s:7:"summary";s:41:"Internal function to handle click actions";s:7:"returns";s:18:"user click actions";s:7:"private";b:1;}s:32:"dijit.form.Button._onButtonClick";a:7:{s:9:"prototype";s:17:"dijit.form.Button";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:543:" if(e.type!='click' && !(this.type=="submit" || this.type=="reset")){
dojo.stopEvent(e);
}
if(this._onClick(e) === false){ // returning nothing is same as true
e.preventDefault(); // needed for checkbox
}else if(this.type=="submit" && !this.focusNode.form){ // see if a nonform widget needs to be signalled
for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
var widget=dijit.byNode(node);
if(widget && typeof widget._onSubmit == "function"){
widget._onSubmit(e);
break;
}
}
}";s:7:"summary";s:126:"Handler when the user activates the button portion.
If is activated via a keystroke, stop the event unless is submit or reset.";s:7:"returns";s:33:"returning nothing is same as true";s:7:"private";b:1;}s:31:"dijit.form.Button._setValueAttr";a:7:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:3276:"dojo.provide("dijit.form.Button");
dojo.require("dijit.form._FormWidget");
dojo.require("dijit._Container");
dojo.declare("dijit.form.Button",
dijit.form._FormWidget,
{
// summary:
// Basically the same thing as a normal HTML button, but with special styling.
// description:
// Buttons can display a label, an icon, or both.
// A label should always be specified (through innerHTML) or the label
// attribute. It can be hidden via showLabel=false.
// example:
// |
//
// example:
// | var button1 = new dijit.form.Button({label: "hello world", onClick: foo});
// | dojo.body().appendChild(button1.domNode);
// label: HTML String
// Text to display in button.
// If the label is hidden (showLabel=false) then and no title has
// been specified, then label is also set as title attribute of icon.
label: "",
// showLabel: Boolean
// Set this to true to hide the label text and display only the icon.
// (If showLabel=false then iconClass must be specified.)
// Especially useful for toolbars.
// If showLabel=true, the label will become the title (a.k.a. tooltip/hint) of the icon.
//
// The exception case is for computers in high-contrast mode, where the label
// will still be displayed, since the icon doesn't appear.
showLabel: true,
// iconClass: String
// Class to apply to div in button to make it display an icon
iconClass: "",
// type: String
// Defines the type of button. "button", "submit", or "reset".
type: "button",
baseClass: "dijitButton",
templatePath: dojo.moduleUrl("dijit.form", "templates/Button.html"),
attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
label: { node: "containerNode", type: "innerHTML" },
iconClass: { node: "iconNode", type: "class" }
}),
_onClick: function(/*Event*/ e){
// summary:
// Internal function to handle click actions
if(this.disabled || this.readOnly){
return false;
}
this._clicked(); // widget click actions
return this.onClick(e); // user click actions
},
_onButtonClick: function(/*Event*/ e){
// summary:
// Handler when the user activates the button portion.
// If is activated via a keystroke, stop the event unless is submit or reset.
if(e.type!='click' && !(this.type=="submit" || this.type=="reset")){
dojo.stopEvent(e);
}
if(this._onClick(e) === false){ // returning nothing is same as true
e.preventDefault(); // needed for checkbox
}else if(this.type=="submit" && !this.focusNode.form){ // see if a nonform widget needs to be signalled
for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
var widget=dijit.byNode(node);
if(widget && typeof widget._onSubmit == "function"){
widget._onSubmit(e);
break;
}
}
}
},
_setValueAttr: function(/*String*/ value){
// Verify that value cannot be set for BUTTON elements.
var attr = this.attributeMap.value || '';
if(this[attr.node||attr||'domNode'].tagName == 'BUTTON'){
// On IE, setting value actually overrides innerHTML, so disallow for everyone for consistency
if(value != this.value){
console.debug('Cannot change the value attribute on a Button widget.');
}
}";s:7:"returns";s:52:"user click actions|returning nothing is same as true";s:7:"private";b:1;s:7:"summary";s:0:"";}s:30:"dijit.form.Button._fillContent";a:7:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"source";a:1:{s:4:"type";s:7:"DomNode";}}s:6:"source";s:3568:"dojo.provide("dijit.form.Button");
dojo.require("dijit.form._FormWidget");
dojo.require("dijit._Container");
dojo.declare("dijit.form.Button",
dijit.form._FormWidget,
{
// summary:
// Basically the same thing as a normal HTML button, but with special styling.
// description:
// Buttons can display a label, an icon, or both.
// A label should always be specified (through innerHTML) or the label
// attribute. It can be hidden via showLabel=false.
// example:
// |
//
// example:
// | var button1 = new dijit.form.Button({label: "hello world", onClick: foo});
// | dojo.body().appendChild(button1.domNode);
// label: HTML String
// Text to display in button.
// If the label is hidden (showLabel=false) then and no title has
// been specified, then label is also set as title attribute of icon.
label: "",
// showLabel: Boolean
// Set this to true to hide the label text and display only the icon.
// (If showLabel=false then iconClass must be specified.)
// Especially useful for toolbars.
// If showLabel=true, the label will become the title (a.k.a. tooltip/hint) of the icon.
//
// The exception case is for computers in high-contrast mode, where the label
// will still be displayed, since the icon doesn't appear.
showLabel: true,
// iconClass: String
// Class to apply to div in button to make it display an icon
iconClass: "",
// type: String
// Defines the type of button. "button", "submit", or "reset".
type: "button",
baseClass: "dijitButton",
templatePath: dojo.moduleUrl("dijit.form", "templates/Button.html"),
attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
label: { node: "containerNode", type: "innerHTML" },
iconClass: { node: "iconNode", type: "class" }
}),
_onClick: function(/*Event*/ e){
// summary:
// Internal function to handle click actions
if(this.disabled || this.readOnly){
return false;
}
this._clicked(); // widget click actions
return this.onClick(e); // user click actions
},
_onButtonClick: function(/*Event*/ e){
// summary:
// Handler when the user activates the button portion.
// If is activated via a keystroke, stop the event unless is submit or reset.
if(e.type!='click' && !(this.type=="submit" || this.type=="reset")){
dojo.stopEvent(e);
}
if(this._onClick(e) === false){ // returning nothing is same as true
e.preventDefault(); // needed for checkbox
}else if(this.type=="submit" && !this.focusNode.form){ // see if a nonform widget needs to be signalled
for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
var widget=dijit.byNode(node);
if(widget && typeof widget._onSubmit == "function"){
widget._onSubmit(e);
break;
}
}
}
},
_setValueAttr: function(/*String*/ value){
// Verify that value cannot be set for BUTTON elements.
var attr = this.attributeMap.value || '';
if(this[attr.node||attr||'domNode'].tagName == 'BUTTON'){
// On IE, setting value actually overrides innerHTML, so disallow for everyone for consistency
if(value != this.value){
console.debug('Cannot change the value attribute on a Button widget.');
}
}
},
_fillContent: function(/*DomNode*/ source){
// Overrides _Templated._fillcContent().
// If button label is specified as srcNodeRef.innerHTML rather than
// this.params.label, handle it here.
if(source && !("label" in this.params)){
this.attr('label', source.innerHTML);
}";s:7:"returns";s:52:"user click actions|returning nothing is same as true";s:7:"private";b:1;s:7:"summary";s:0:"";}s:28:"dijit.form.Button.postCreate";a:4:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:8:"Function";s:6:"source";s:166:" if (this.showLabel == false){
dojo.addClass(this.containerNode,"dijitDisplayNone");
}
dojo.setSelectable(this.focusNode, false);
this.inherited(arguments);";s:7:"summary";s:0:"";}s:25:"dijit.form.Button.onClick";a:6:{s:9:"prototype";s:17:"dijit.form.Button";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:26:" return true; // Boolean";s:7:"summary";s:133:"Callback for when button is clicked.
If type="submit", return true to perform submit, or false to cancel it.
type:
callback";s:7:"returns";s:7:"Boolean";}s:26:"dijit.form.Button._clicked";a:6:{s:9:"prototype";s:17:"dijit.form.Button";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:80:" // summary:
// Internal overridable function for when the button is clicked";s:7:"summary";s:60:"Internal overridable function for when the button is clicked";s:7:"private";b:1;}s:26:"dijit.form.Button.setLabel";a:5:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"content";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:140:" dojo.deprecated("dijit.form.Button.setLabel() is deprecated. Use attr('label', ...) instead.", "", "2.0");
this.attr("label", content);";s:7:"summary";s:44:"Deprecated. Use attr('label', ...) instead.";}s:31:"dijit.form.Button._setLabelAttr";a:7:{s:9:"prototype";s:17:"dijit.form.Button";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"content";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:241:" this.containerNode.innerHTML = this.label = content;
this._layoutHack();
if (this.showLabel == false && !this.params.title){
this.titleNode.title = dojo.trim(this.containerNode.innerText || this.containerNode.textContent || '');
}";s:7:"summary";s:36:"Hook for attr('label', ...) to work.";s:11:"description";s:57:"Set the label (text) of the button; takes an HTML string.";s:7:"private";b:1;}s:41:"dijit.form.Button.containerNode.innerHTML";a:2:{s:8:"instance";s:17:"dijit.form.Button";s:7:"summary";s:0:"";}s:33:"dijit.form.Button.titleNode.title";a:2:{s:8:"instance";s:17:"dijit.form.Button";s:7:"summary";s:0:"";}s:25:"dijit.form.DropDownButton";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:17:"dijit.form.Button";}s:4:"call";a:2:{i:0;s:17:"dijit.form.Button";i:1;s:16:"dijit._Container";}}s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:26:"dijit._Container.prototype";}}s:7:"summary";s:25:"A button with a drop down";s:8:"examples";a:2:{i:0;s:118:"
";i:1;s:130:"
var button1 = new dijit.form.DropDownButton({ label: "hi", dropDown: new dijit.Menu(...) });
dojo.body().appendChild(button1);";}s:9:"classlike";b:1;}s:35:"dijit.form.DropDownButton.baseClass";a:2:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:7:"summary";s:0:"";}s:38:"dijit.form.DropDownButton.templatePath";a:2:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:7:"summary";s:0:"";}s:38:"dijit.form.DropDownButton._fillContent";a:7:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:6:"source";s:6163:"dojo.provide("dijit.form.Button");
dojo.require("dijit.form._FormWidget");
dojo.require("dijit._Container");
dojo.declare("dijit.form.Button",
dijit.form._FormWidget,
{
// summary:
// Basically the same thing as a normal HTML button, but with special styling.
// description:
// Buttons can display a label, an icon, or both.
// A label should always be specified (through innerHTML) or the label
// attribute. It can be hidden via showLabel=false.
// example:
// |
//
// example:
// | var button1 = new dijit.form.Button({label: "hello world", onClick: foo});
// | dojo.body().appendChild(button1.domNode);
// label: HTML String
// Text to display in button.
// If the label is hidden (showLabel=false) then and no title has
// been specified, then label is also set as title attribute of icon.
label: "",
// showLabel: Boolean
// Set this to true to hide the label text and display only the icon.
// (If showLabel=false then iconClass must be specified.)
// Especially useful for toolbars.
// If showLabel=true, the label will become the title (a.k.a. tooltip/hint) of the icon.
//
// The exception case is for computers in high-contrast mode, where the label
// will still be displayed, since the icon doesn't appear.
showLabel: true,
// iconClass: String
// Class to apply to div in button to make it display an icon
iconClass: "",
// type: String
// Defines the type of button. "button", "submit", or "reset".
type: "button",
baseClass: "dijitButton",
templatePath: dojo.moduleUrl("dijit.form", "templates/Button.html"),
attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
label: { node: "containerNode", type: "innerHTML" },
iconClass: { node: "iconNode", type: "class" }
}),
_onClick: function(/*Event*/ e){
// summary:
// Internal function to handle click actions
if(this.disabled || this.readOnly){
return false;
}
this._clicked(); // widget click actions
return this.onClick(e); // user click actions
},
_onButtonClick: function(/*Event*/ e){
// summary:
// Handler when the user activates the button portion.
// If is activated via a keystroke, stop the event unless is submit or reset.
if(e.type!='click' && !(this.type=="submit" || this.type=="reset")){
dojo.stopEvent(e);
}
if(this._onClick(e) === false){ // returning nothing is same as true
e.preventDefault(); // needed for checkbox
}else if(this.type=="submit" && !this.focusNode.form){ // see if a nonform widget needs to be signalled
for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
var widget=dijit.byNode(node);
if(widget && typeof widget._onSubmit == "function"){
widget._onSubmit(e);
break;
}
}
}
},
_setValueAttr: function(/*String*/ value){
// Verify that value cannot be set for BUTTON elements.
var attr = this.attributeMap.value || '';
if(this[attr.node||attr||'domNode'].tagName == 'BUTTON'){
// On IE, setting value actually overrides innerHTML, so disallow for everyone for consistency
if(value != this.value){
console.debug('Cannot change the value attribute on a Button widget.');
}
}
},
_fillContent: function(/*DomNode*/ source){
// Overrides _Templated._fillcContent().
// If button label is specified as srcNodeRef.innerHTML rather than
// this.params.label, handle it here.
if(source && !("label" in this.params)){
this.attr('label', source.innerHTML);
}
},
postCreate: function(){
if (this.showLabel == false){
dojo.addClass(this.containerNode,"dijitDisplayNone");
}
dojo.setSelectable(this.focusNode, false);
this.inherited(arguments);
},
onClick: function(/*Event*/ e){
// summary:
// Callback for when button is clicked.
// If type="submit", return true to perform submit, or false to cancel it.
// type:
// callback
return true; // Boolean
},
_clicked: function(/*Event*/ e){
// summary:
// Internal overridable function for when the button is clicked
},
setLabel: function(/*String*/ content){
// summary:
// Deprecated. Use attr('label', ...) instead.
dojo.deprecated("dijit.form.Button.setLabel() is deprecated. Use attr('label', ...) instead.", "", "2.0");
this.attr("label", content);
},
_setLabelAttr: function(/*String*/ content){
// summary:
// Hook for attr('label', ...) to work.
// description:
// Set the label (text) of the button; takes an HTML string.
this.containerNode.innerHTML = this.label = content;
this._layoutHack();
if (this.showLabel == false && !this.params.title){
this.titleNode.title = dojo.trim(this.containerNode.innerText || this.containerNode.textContent || '');
}
}
});
dojo.declare("dijit.form.DropDownButton", [dijit.form.Button, dijit._Container], {
// summary:
// A button with a drop down
//
// example:
// |
//
// example:
// | var button1 = new dijit.form.DropDownButton({ label: "hi", dropDown: new dijit.Menu(...) });
// | dojo.body().appendChild(button1);
//
baseClass : "dijitDropDownButton",
templatePath: dojo.moduleUrl("dijit.form" , "templates/DropDownButton.html"),
_fillContent: function(){
// Overrides Button._fillContent().
//
// My inner HTML contains both the button contents and a drop down widget, like
// push me
// The first node is assumed to be the button content. The widget is the popup.
if(this.srcNodeRef){ // programatically created buttons might not define srcNodeRef
//FIXME: figure out how to filter out the widget and use all remaining nodes as button
// content, not just nodes[0]
var nodes = dojo.query("*", this.srcNodeRef);
dijit.form.DropDownButton.superclass._fillContent.call(this, nodes[0]);
// save pointer to srcNode so we can grab the drop down widget after it's instantiated
this.dropDownContainer = this.srcNodeRef;
}";s:7:"returns";s:60:"user click actions|returning nothing is same as true|Boolean";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:49:"dijit.form.DropDownButton.superclass._fillContent";}}s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dijit.form.DropDownButton.startup";a:4:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:6:"source";s:454:" if(this._started){ return; }
// the child widget from srcNodeRef is the dropdown widget. Insert it in the page DOM,
// make it invisible, and store a reference to pass to the popup code.
if(!this.dropDown){
var dropDownNode = dojo.query("[widgetId]", this.dropDownContainer)[0];
this.dropDown = dijit.byNode(dropDownNode);
delete this.dropDownContainer;
}
dijit.popup.prepare(this.dropDown.domNode);
this.inherited(arguments);";s:7:"summary";s:0:"";}s:44:"dijit.form.DropDownButton.destroyDescendants";a:4:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:6:"source";s:115:" if(this.dropDown){
this.dropDown.destroyRecursive();
delete this.dropDown;
}
this.inherited(arguments);";s:7:"summary";s:0:"";}s:39:"dijit.form.DropDownButton._onArrowClick";a:6:{s:9:"prototype";s:25:"dijit.form.DropDownButton";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:73:" if(this.disabled || this.readOnly){ return; }
this._toggleDropDown();";s:7:"summary";s:57:"Handler for when the user mouse clicks on menu popup node";s:7:"private";b:1;}s:42:"dijit.form.DropDownButton._onDropDownClick";a:7:{s:9:"prototype";s:25:"dijit.form.DropDownButton";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:7608:"dojo.provide("dijit.form.Button");
dojo.require("dijit.form._FormWidget");
dojo.require("dijit._Container");
dojo.declare("dijit.form.Button",
dijit.form._FormWidget,
{
// summary:
// Basically the same thing as a normal HTML button, but with special styling.
// description:
// Buttons can display a label, an icon, or both.
// A label should always be specified (through innerHTML) or the label
// attribute. It can be hidden via showLabel=false.
// example:
// |
//
// example:
// | var button1 = new dijit.form.Button({label: "hello world", onClick: foo});
// | dojo.body().appendChild(button1.domNode);
// label: HTML String
// Text to display in button.
// If the label is hidden (showLabel=false) then and no title has
// been specified, then label is also set as title attribute of icon.
label: "",
// showLabel: Boolean
// Set this to true to hide the label text and display only the icon.
// (If showLabel=false then iconClass must be specified.)
// Especially useful for toolbars.
// If showLabel=true, the label will become the title (a.k.a. tooltip/hint) of the icon.
//
// The exception case is for computers in high-contrast mode, where the label
// will still be displayed, since the icon doesn't appear.
showLabel: true,
// iconClass: String
// Class to apply to div in button to make it display an icon
iconClass: "",
// type: String
// Defines the type of button. "button", "submit", or "reset".
type: "button",
baseClass: "dijitButton",
templatePath: dojo.moduleUrl("dijit.form", "templates/Button.html"),
attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
label: { node: "containerNode", type: "innerHTML" },
iconClass: { node: "iconNode", type: "class" }
}),
_onClick: function(/*Event*/ e){
// summary:
// Internal function to handle click actions
if(this.disabled || this.readOnly){
return false;
}
this._clicked(); // widget click actions
return this.onClick(e); // user click actions
},
_onButtonClick: function(/*Event*/ e){
// summary:
// Handler when the user activates the button portion.
// If is activated via a keystroke, stop the event unless is submit or reset.
if(e.type!='click' && !(this.type=="submit" || this.type=="reset")){
dojo.stopEvent(e);
}
if(this._onClick(e) === false){ // returning nothing is same as true
e.preventDefault(); // needed for checkbox
}else if(this.type=="submit" && !this.focusNode.form){ // see if a nonform widget needs to be signalled
for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
var widget=dijit.byNode(node);
if(widget && typeof widget._onSubmit == "function"){
widget._onSubmit(e);
break;
}
}
}
},
_setValueAttr: function(/*String*/ value){
// Verify that value cannot be set for BUTTON elements.
var attr = this.attributeMap.value || '';
if(this[attr.node||attr||'domNode'].tagName == 'BUTTON'){
// On IE, setting value actually overrides innerHTML, so disallow for everyone for consistency
if(value != this.value){
console.debug('Cannot change the value attribute on a Button widget.');
}
}
},
_fillContent: function(/*DomNode*/ source){
// Overrides _Templated._fillcContent().
// If button label is specified as srcNodeRef.innerHTML rather than
// this.params.label, handle it here.
if(source && !("label" in this.params)){
this.attr('label', source.innerHTML);
}
},
postCreate: function(){
if (this.showLabel == false){
dojo.addClass(this.containerNode,"dijitDisplayNone");
}
dojo.setSelectable(this.focusNode, false);
this.inherited(arguments);
},
onClick: function(/*Event*/ e){
// summary:
// Callback for when button is clicked.
// If type="submit", return true to perform submit, or false to cancel it.
// type:
// callback
return true; // Boolean
},
_clicked: function(/*Event*/ e){
// summary:
// Internal overridable function for when the button is clicked
},
setLabel: function(/*String*/ content){
// summary:
// Deprecated. Use attr('label', ...) instead.
dojo.deprecated("dijit.form.Button.setLabel() is deprecated. Use attr('label', ...) instead.", "", "2.0");
this.attr("label", content);
},
_setLabelAttr: function(/*String*/ content){
// summary:
// Hook for attr('label', ...) to work.
// description:
// Set the label (text) of the button; takes an HTML string.
this.containerNode.innerHTML = this.label = content;
this._layoutHack();
if (this.showLabel == false && !this.params.title){
this.titleNode.title = dojo.trim(this.containerNode.innerText || this.containerNode.textContent || '');
}
}
});
dojo.declare("dijit.form.DropDownButton", [dijit.form.Button, dijit._Container], {
// summary:
// A button with a drop down
//
// example:
// |
//
// example:
// | var button1 = new dijit.form.DropDownButton({ label: "hi", dropDown: new dijit.Menu(...) });
// | dojo.body().appendChild(button1);
//
baseClass : "dijitDropDownButton",
templatePath: dojo.moduleUrl("dijit.form" , "templates/DropDownButton.html"),
_fillContent: function(){
// Overrides Button._fillContent().
//
// My inner HTML contains both the button contents and a drop down widget, like
// push me
// The first node is assumed to be the button content. The widget is the popup.
if(this.srcNodeRef){ // programatically created buttons might not define srcNodeRef
//FIXME: figure out how to filter out the widget and use all remaining nodes as button
// content, not just nodes[0]
var nodes = dojo.query("*", this.srcNodeRef);
dijit.form.DropDownButton.superclass._fillContent.call(this, nodes[0]);
// save pointer to srcNode so we can grab the drop down widget after it's instantiated
this.dropDownContainer = this.srcNodeRef;
}
},
startup: function(){
if(this._started){ return; }
// the child widget from srcNodeRef is the dropdown widget. Insert it in the page DOM,
// make it invisible, and store a reference to pass to the popup code.
if(!this.dropDown){
var dropDownNode = dojo.query("[widgetId]", this.dropDownContainer)[0];
this.dropDown = dijit.byNode(dropDownNode);
delete this.dropDownContainer;
}
dijit.popup.prepare(this.dropDown.domNode);
this.inherited(arguments);
},
destroyDescendants: function(){
if(this.dropDown){
this.dropDown.destroyRecursive();
delete this.dropDown;
}
this.inherited(arguments);
},
_onArrowClick: function(/*Event*/ e){
// summary:
// Handler for when the user mouse clicks on menu popup node
if(this.disabled || this.readOnly){ return; }
this._toggleDropDown();
},
_onDropDownClick: function(/*Event*/ e){
// on Firefox 2 on the Mac it is possible to fire onclick
// by pressing enter down on a second element and transferring
// focus to the DropDownButton;
// we want to prevent opening our menu in this situation
// and only do so if we have seen a keydown on this button;
// e.detail != 0 means that we were fired by mouse
var isMacFFlessThan3 = dojo.isFF && dojo.isFF < 3
&& navigator.appVersion.indexOf("Macintosh") != -1;
if(!isMacFFlessThan3 || e.detail != 0 || this._seenKeydown){
this._onArrowClick(e);
}
this._seenKeydown = false;";s:7:"returns";s:60:"user click actions|returning nothing is same as true|Boolean";s:7:"private";b:1;s:7:"summary";s:0:"";}s:44:"dijit.form.DropDownButton._onDropDownKeydown";a:6:{s:9:"prototype";s:25:"dijit.form.DropDownButton";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:27:" this._seenKeydown = true;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:41:"dijit.form.DropDownButton._onDropDownBlur";a:6:{s:9:"prototype";s:25:"dijit.form.DropDownButton";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:28:" this._seenKeydown = false;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:32:"dijit.form.DropDownButton._onKey";a:6:{s:9:"prototype";s:25:"dijit.form.DropDownButton";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:226:" if(this.disabled || this.readOnly){ return; }
if(e.charOrCode == dojo.keys.DOWN_ARROW){
if(!this.dropDown || this.dropDown.domNode.style.visibility=="hidden"){
dojo.stopEvent(e);
this._toggleDropDown();
}
}";s:7:"summary";s:55:"Handler when the user presses a key on drop down widget";s:7:"private";b:1;}s:33:"dijit.form.DropDownButton._onBlur";a:5:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:6:"source";s:133:" this._closeDropDown();
// don't focus on button. the user has explicitly focused on something else.
this.inherited(arguments);";s:7:"summary";s:79:"Called magically when focus has shifted away from this widget and it's dropdown";s:7:"private";b:1;}s:41:"dijit.form.DropDownButton._toggleDropDown";a:5:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:6:"source";s:547:" if(this.disabled || this.readOnly){ return; }
dijit.focus(this.popupStateNode);
var dropDown = this.dropDown;
if(!dropDown){ return; }
if(!this._opened){
// If there's an href, then load that first, so we don't get a flicker
if(dropDown.href && !dropDown.isLoaded){
var self = this;
var handler = dojo.connect(dropDown, "onLoad", function(){
dojo.disconnect(handler);
self._openDropDown();
});
dropDown.refresh();
return;
}else{
this._openDropDown();
}
}else{
this._closeDropDown();
}";s:7:"summary";s:68:"Toggle the drop-down widget; if it is up, close it; if not, open it.";s:7:"private";b:1;}s:39:"dijit.form.DropDownButton._openDropDown";a:5:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:6:"source";s:1351:" var dropDown = this.dropDown;
var oldWidth=dropDown.domNode.style.width;
var self = this;
dijit.popup.open({
parent: this,
popup: dropDown,
around: this.domNode,
orient:
// TODO: add user-defined positioning option, like in Tooltip.js
this.isLeftToRight() ? {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'}
: {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'},
onExecute: function(){
self._closeDropDown(true);
},
onCancel: function(){
self._closeDropDown(true);
},
onClose: function(){
dropDown.domNode.style.width = oldWidth;
self.popupStateNode.removeAttribute("popupActive");
self._opened = false;
}
});
if(this.domNode.offsetWidth > dropDown.domNode.offsetWidth){
var adjustNode = null;
if(!this.isLeftToRight()){
adjustNode = dropDown.domNode.parentNode;
var oldRight = adjustNode.offsetLeft + adjustNode.offsetWidth;
}
// make menu at least as wide as the button
dojo.marginBox(dropDown.domNode, {w: this.domNode.offsetWidth});
if(adjustNode){
adjustNode.style.left = oldRight - this.domNode.offsetWidth + "px";
}
}
this.popupStateNode.setAttribute("popupActive", "true");
this._opened=true;
if(dropDown.focus){
dropDown.focus();
}
// TODO: set this.checked and call setStateClass(), to affect button look while drop down is shown";s:7:"private";b:1;s:7:"summary";s:0:"";}s:40:"dijit.form.DropDownButton._closeDropDown";a:6:{s:9:"prototype";s:25:"dijit.form.DropDownButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"focus";a:1:{s:4:"type";s:7:"Boolean";}}s:6:"source";s:118:" if(this._opened){
dijit.popup.close(this.dropDown);
if(focus){ this.focus(); }
this._opened = false;
}";s:7:"private";b:1;s:7:"summary";s:0:"";}s:43:"dijit.form.DropDownButton.dropDownContainer";a:2:{s:8:"instance";s:25:"dijit.form.DropDownButton";s:7:"summary";s:0:"";}s:34:"dijit.form.DropDownButton.dropDown";a:2:{s:8:"instance";s:25:"dijit.form.DropDownButton";s:7:"summary";s:0:"";}s:38:"dijit.form.DropDownButton._seenKeydown";a:3:{s:8:"instance";s:25:"dijit.form.DropDownButton";s:7:"private";b:1;s:7:"summary";s:0:"";}s:59:"dijit.form.DropDownButton.dropDown.domNode.style.visibility";a:2:{s:8:"instance";s:25:"dijit.form.DropDownButton";s:7:"summary";s:0:"";}s:33:"dijit.form.DropDownButton._opened";a:3:{s:8:"instance";s:25:"dijit.form.DropDownButton";s:7:"private";b:1;s:7:"summary";s:0:"";}s:22:"dijit.form.ComboButton";a:5:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:25:"dijit.form.DropDownButton";}s:4:"call";a:1:{i:0;s:25:"dijit.form.DropDownButton";}}s:7:"summary";s:149:"A combination button and drop-down button.
Users can click one side to "press" the button, or click an arrow
icon to display the drop down.";s:8:"examples";a:2:{i:0;s:136:"
";i:1;s:145:"
var button1 = new dijit.form.ComboButton({label: "hello world", onClick: foo, dropDown: "myMenu"});
dojo.body().appendChild(button1.domNode);";}s:9:"classlike";b:1;}s:35:"dijit.form.ComboButton.templatePath";a:2:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:7:"summary";s:0:"";}s:35:"dijit.form.ComboButton.attributeMap";a:2:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:7:"summary";s:0:"";}s:35:"dijit.form.ComboButton.optionsTitle";a:3:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:6:"String";s:7:"summary";s:52:"Text that describes the options menu (accessibility)";}s:32:"dijit.form.ComboButton.baseClass";a:2:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:7:"summary";s:0:"";}s:35:"dijit.form.ComboButton._focusedNode";a:4:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:8:"instance";s:22:"dijit.form.ComboButton";s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dijit.form.ComboButton.postCreate";a:4:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:415:" this.inherited(arguments);
this._focalNodes = [this.titleNode, this.popupStateNode];
dojo.forEach(this._focalNodes, dojo.hitch(this, function(node){
if(dojo.isIE){
this.connect(node, "onactivate", this._onNodeFocus);
this.connect(node, "ondeactivate", this._onNodeBlur);
}else{
this.connect(node, "onfocus", this._onNodeFocus);
this.connect(node, "onblur", this._onNodeBlur);
}
}));";s:7:"summary";s:0:"";}s:37:"dijit.form.ComboButton.focusFocalNode";a:7:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:48:" this._focusedNode = node;
dijit.focus(node);";s:7:"summary";s:26:"Focus the focal node node.";s:11:"description";s:74:"Called by _KeyNavContainer for (when example) this button is in a toolbar.";s:4:"tags";s:9:"protected";}s:39:"dijit.form.ComboButton.hasNextFocalNode";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:55:" return this._focusedNode !== this.getFocalNodes()[1];";s:7:"summary";s:152:"Returns true if this widget has no node currently
focused or if there is a node following the focused one.
False is returned if the last node has focus.";s:11:"description";s:74:"Called by _KeyNavContainer for (when example) this button is in a toolbar.";s:4:"tags";s:9:"protected";}s:32:"dijit.form.ComboButton.focusNext";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:104:" this._focusedNode = this.getFocalNodes()[this._focusedNode ? 1 : 0];
dijit.focus(this._focusedNode);";s:7:"summary";s:108:"Focus the focal node following the current node with focus,
or the first one if no node currently has focus.";s:11:"description";s:74:"Called by _KeyNavContainer for (when example) this button is in a toolbar.";s:4:"tags";s:9:"protected";}s:39:"dijit.form.ComboButton.hasPrevFocalNode";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:55:" return this._focusedNode !== this.getFocalNodes()[0];";s:7:"summary";s:150:"Returns true if this widget has no node currently
focused or if there is a node before the focused one.
False is returned if the first node has focus.";s:11:"description";s:74:"Called by _KeyNavContainer for (when example) this button is in a toolbar.";s:4:"tags";s:9:"protected";}s:32:"dijit.form.ComboButton.focusPrev";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:104:" this._focusedNode = this.getFocalNodes()[this._focusedNode ? 0 : 1];
dijit.focus(this._focusedNode);";s:7:"summary";s:103:"Focus the focal node before the current node with focus
or the last one if no node currently has focus.";s:11:"description";s:74:"Called by _KeyNavContainer for (when example) this button is in a toolbar.";s:4:"tags";s:9:"protected";}s:36:"dijit.form.ComboButton.getFocalNodes";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:26:" return this._focalNodes;";s:7:"summary";s:48:"Returns an array of focal nodes for this widget.";s:11:"description";s:74:"Called by _KeyNavContainer for (when example) this button is in a toolbar.";s:4:"tags";s:9:"protected";}s:35:"dijit.form.ComboButton._onNodeFocus";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:193:" this._focusedNode = evt.currentTarget;
var fnc = this._focusedNode == this.focusNode ? "dijitDownArrowButtonFocused" : "dijitButtonContentsFocused";
dojo.addClass(this._focusedNode, fnc);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:34:"dijit.form.ComboButton._onNodeBlur";a:6:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:155:" var fnc = evt.currentTarget == this.focusNode ? "dijitDownArrowButtonFocused" : "dijitButtonContentsFocused";
dojo.removeClass(evt.currentTarget, fnc);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:30:"dijit.form.ComboButton._onBlur";a:5:{s:9:"prototype";s:22:"dijit.form.ComboButton";s:4:"type";s:8:"Function";s:6:"source";s:56:" this.inherited(arguments);
this._focusedNode = null;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:34:"dijit.form.ComboButton._focalNodes";a:3:{s:8:"instance";s:22:"dijit.form.ComboButton";s:7:"private";b:1;s:7:"summary";s:0:"";}s:23:"dijit.form.ToggleButton";a:4:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:17:"dijit.form.Button";}s:4:"call";a:1:{i:0;s:17:"dijit.form.Button";}}s:7:"summary";s:120:"A button that can be in two states (checked or not).
Can be base class for things like tabs or checkbox or radio buttons";s:9:"classlike";b:1;}s:33:"dijit.form.ToggleButton.baseClass";a:2:{s:9:"prototype";s:23:"dijit.form.ToggleButton";s:7:"summary";s:0:"";}s:31:"dijit.form.ToggleButton.checked";a:4:{s:9:"prototype";s:23:"dijit.form.ToggleButton";s:8:"instance";s:23:"dijit.form.ToggleButton";s:4:"type";s:7:"Boolean";s:7:"summary";s:247:"Corresponds to the native HTML <input> element's attribute.
In markup, specified as "checked='checked'" or just "checked".
True if the button is depressed, or the checkbox is checked,
or the radio button is selected, etc.";}s:36:"dijit.form.ToggleButton.attributeMap";a:2:{s:9:"prototype";s:23:"dijit.form.ToggleButton";s:7:"summary";s:0:"";}s:32:"dijit.form.ToggleButton._clicked";a:6:{s:9:"prototype";s:23:"dijit.form.ToggleButton";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:38:" this.attr('checked', !this.checked);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:39:"dijit.form.ToggleButton._setCheckedAttr";a:6:{s:9:"prototype";s:23:"dijit.form.ToggleButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:7:"Boolean";}}s:6:"source";s:221:" this.checked = value;
dojo.attr(this.focusNode || this.domNode, "checked", value);
dijit.setWaiState(this.focusNode || this.domNode, "pressed", value);
this._setStateClass();
this._handleOnChange(value, true);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:34:"dijit.form.ToggleButton.setChecked";a:5:{s:9:"prototype";s:23:"dijit.form.ToggleButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"checked";a:1:{s:4:"type";s:7:"Boolean";}}s:6:"source";s:145:" dojo.deprecated("setChecked("+checked+") is deprecated. Use attr('checked',"+checked+") instead.", "", "2.0");
this.attr('checked', checked);";s:7:"summary";s:54:"Deprecated. Use attr('checked', true/false) instead.";}s:29:"dijit.form.ToggleButton.reset";a:4:{s:9:"prototype";s:23:"dijit.form.ToggleButton";s:4:"type";s:8:"Function";s:6:"source";s:130:" this._hasBeenBlurred = false;
// set checked state to original setting
this.attr('checked', this.params.checked || false);";s:7:"summary";s:62:"Reset the widget's value to what it was at initialization time";}s:39:"dijit.form.ToggleButton._hasBeenBlurred";a:3:{s:8:"instance";s:23:"dijit.form.ToggleButton";s:7:"private";b:1;s:7:"summary";s:0:"";}s:10:"dijit.form";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:"";}}