a:34:{s:9:"#provides";s:18:"dijit.form.TextBox";s:9:"#resource";s:15:"form/TextBox.js";s:9:"#requires";a:1:{i:0;a:2:{i:0;s:6:"common";i:1;s:22:"dijit.form._FormWidget";}}s:18:"dijit.form.TextBox";a:4:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:27:"dijit.form._FormValueWidget";}s:4:"call";a:1:{i:0;s:27:"dijit.form._FormValueWidget";}}s:7:"summary";s:36:"A base class for textbox form inputs";s:9:"classlike";b:1;}s:23:"dijit.form.TextBox.trim";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:7:"Boolean";s:7:"summary";s:67:"Removes leading and trailing whitespace if true. Default is false.";}s:28:"dijit.form.TextBox.uppercase";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:7:"Boolean";s:7:"summary";s:64:"Converts all characters to uppercase if true. Default is false.";}s:28:"dijit.form.TextBox.lowercase";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:7:"Boolean";s:7:"summary";s:64:"Converts all characters to lowercase if true. Default is false.";}s:29:"dijit.form.TextBox.propercase";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:7:"Boolean";s:7:"summary";s:63:"Converts the first character of each word to uppercase if true.";}s:28:"dijit.form.TextBox.maxLength";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:6:"String";s:7:"summary";s:37:"HTML INPUT tag maxLength declaration.";}s:31:"dijit.form.TextBox.templatePath";a:2:{s:9:"prototype";s:18:"dijit.form.TextBox";s:7:"summary";s:0:"";}s:28:"dijit.form.TextBox.baseClass";a:2:{s:9:"prototype";s:18:"dijit.form.TextBox";s:7:"summary";s:0:"";}s:31:"dijit.form.TextBox.attributeMap";a:2:{s:9:"prototype";s:18:"dijit.form.TextBox";s:7:"summary";s:0:"";}s:32:"dijit.form.TextBox._getValueAttr";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:68:" return this.parse(this.attr('displayedValue'), this.constraints);";s:7:"summary";s:39:"Hook so attr('value') works as we like.";s:11:"description";s:292:"For `dijit.form.TextBox` this basically returns the value of the . For `dijit.form.MappedTextBox` subclasses, which have both a "displayed value" and a separate "submit value", This treats the "displayed value" as the master value, computing the submit value from it via this.parse().";s:7:"private";b:1;}s:32:"dijit.form.TextBox._setValueAttr";a:7:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:5:"value";a:2:{s:4:"type";s:3:"The";s:7:"summary";s:89:"visual element value is also set to a corresponding, but not necessarily the same, value.";}s:14:"priorityChange";a:3:{s:8:"optional";b:1;s:4:"type";s:7:"Boolean";s:7:"summary";s:91:"If true, an onChange event is fired immediately instead of waiting for the next blur event.";}s:14:"formattedValue";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:94:"If specified, used to set the visual element value, otherwise a computed visual value is used.";}}s:6:"source";s:812:" var filteredValue; if(value !== undefined){ // TODO: this is calling filter() on both the display value and the actual value. // I added a comment to the filter() definition about this, but it should be changed. filteredValue = this.filter(value); if(typeof formattedValue != "string"){ if(filteredValue !== null && ((typeof filteredValue != "number") || !isNaN(filteredValue))){ formattedValue = this.filter(this.format(filteredValue, this.constraints)); }else{ formattedValue = ''; } } } if(formattedValue != null && formattedValue != undefined && ((typeof formattedValue) != "number" || !isNaN(formattedValue)) && this.textbox.value != formattedValue){ this.textbox.value = formattedValue; } this.inherited(arguments, [filteredValue, priorityChange]);";s:7:"summary";s:33:"Hook so attr('value', ...) works.";s:11:"description";s:93:"Sets the value of the widget to "value" which can be of any type as determined by the widget.";s:7:"private";b:1;}s:33:"dijit.form.TextBox.displayedValue";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:6:"String";s:7:"summary";s:458:"For subclasses like ComboBox where the displayed value (ex: Kentucky) and the serialized value (ex: KY) are different, this represents the displayed value. Setting 'displayedValue' through attr('displayedValue', ...) updates 'value', and vice-versa. Othewise 'value' is updated from 'displayedValue' periodically, like onBlur etc. TODO: move declaration to MappedTextBox? Problem is that ComboBox references displayedValue, for benefit of FilteringSelect.";}s:36:"dijit.form.TextBox.getDisplayedValue";a:5:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:164:" dojo.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use attr('displayedValue') instead.", "", "2.0"); return this.attr('displayedValue');";s:7:"summary";s:49:"Deprecated. Use attr('displayedValue') instead.";s:4:"tags";s:10:"deprecated";}s:41:"dijit.form.TextBox._getDisplayedValueAttr";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:42:" return this.filter(this.textbox.value);";s:7:"summary";s:37:"Hook so attr('displayedValue') works.";s:11:"description";s:295:"Returns the displayed value (what the user sees on the screen), after filtering (ie, trimming spaces etc.). For some subclasses of TextBox (like ComboBox), the displayed value is different from the serialized value that's actually sent to the server (see dijit.form.ValidationTextBox.serialize)";s:7:"private";b:1;}s:36:"dijit.form.TextBox.setDisplayedValue";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";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:169:" dojo.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use attr('displayedValue', ...) instead.", "", "2.0"); this.attr('displayedValue', value);";s:7:"summary";s:54:"Deprecated. Use attr('displayedValue', ...) instead.";s:4:"tags";s:10:"deprecated";}s:41:"dijit.form.TextBox._setDisplayedValueAttr";a:7:{s:9:"prototype";s:18:"dijit.form.TextBox";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:212:" if(value === null || value === undefined){ value = '' } else if(typeof value != "string"){ value = String(value) } this.textbox.value = value; this._setValueAttr(this.attr('value'), undefined, value);";s:7:"summary";s:42:"Hook so attr('displayedValue', ...) works.";s:11:"description";s:145:"Sets the value of the visual element to the string "value". The widget value is also set to a corresponding, but not necessarily the same, value.";s:7:"private";b:1;}s:25:"dijit.form.TextBox.format";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:6:"String";}s:11:"constraints";a:1:{s:4:"type";s:6:"Object";}}s:6:"source";s:101:" return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value));";s:7:"summary";s:70:"Replacable function to convert a value to a properly formatted string.";s:4:"tags";s:19:"protected extension";}s:24:"dijit.form.TextBox.parse";a:7:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:6:"String";}s:11:"constraints";a:1:{s:4:"type";s:6:"Object";}}s:6:"source";s:26:" return value; // String";s:7:"summary";s:60:"Replacable function to convert a formatted string to a value";s:4:"tags";s:19:"protected extension";s:7:"returns";s:6:"String";}s:32:"dijit.form.TextBox._refreshState";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:247:" // summary: // After the user types some characters, etc., this method is // called to check the field for validity etc. The base method // in `dijit.form.TextBox` does nothing, but subclasses override. // tags: // protected";s:7:"summary";s:182:"After the user types some characters, etc., this method is called to check the field for validity etc. The base method in `dijit.form.TextBox` does nothing, but subclasses override.";s:4:"tags";s:9:"protected";s:7:"private";b:1;}s:27:"dijit.form.TextBox._onInput";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:445:" if(e && e.type && /key/i.test(e.type) && e.keyCode){ switch(e.keyCode){ case dojo.keys.SHIFT: case dojo.keys.ALT: case dojo.keys.CTRL: case dojo.keys.TAB: return; } } if(this.intermediateChanges){ var _this = this; // the setTimeout allows the key to post to the widget input box setTimeout(function(){ _this._handleOnChange(_this.attr('value'), false); }, 0); } this._refreshState();";s:7:"private";b:1;s:7:"summary";s:0:"";}s:29:"dijit.form.TextBox.postCreate";a:5:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:7380:"dojo.provide("dijit.form.TextBox"); dojo.require("dijit.form._FormWidget"); dojo.declare( "dijit.form.TextBox", dijit.form._FormValueWidget, { // summary: // A base class for textbox form inputs // trim: Boolean // Removes leading and trailing whitespace if true. Default is false. trim: false, // uppercase: Boolean // Converts all characters to uppercase if true. Default is false. uppercase: false, // lowercase: Boolean // Converts all characters to lowercase if true. Default is false. lowercase: false, // propercase: Boolean // Converts the first character of each word to uppercase if true. propercase: false, // maxLength: String // HTML INPUT tag maxLength declaration. maxLength: "", templatePath: dojo.moduleUrl("dijit.form", "templates/TextBox.html"), baseClass: "dijitTextBox", attributeMap: dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap, { maxLength: "focusNode" }), _getValueAttr: function(){ // summary: // Hook so attr('value') works as we like. // description: // For `dijit.form.TextBox` this basically returns the value of the . // // For `dijit.form.MappedTextBox` subclasses, which have both // a "displayed value" and a separate "submit value", // This treats the "displayed value" as the master value, computing the // submit value from it via this.parse(). return this.parse(this.attr('displayedValue'), this.constraints); }, _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){ // summary: // Hook so attr('value', ...) works. // // description: // Sets the value of the widget to "value" which can be of // any type as determined by the widget. // // value: // The visual element value is also set to a corresponding, // but not necessarily the same, value. // // formattedValue: // If specified, used to set the visual element value, // otherwise a computed visual value is used. // // priorityChange: // If true, an onChange event is fired immediately instead of // waiting for the next blur event. var filteredValue; if(value !== undefined){ // TODO: this is calling filter() on both the display value and the actual value. // I added a comment to the filter() definition about this, but it should be changed. filteredValue = this.filter(value); if(typeof formattedValue != "string"){ if(filteredValue !== null && ((typeof filteredValue != "number") || !isNaN(filteredValue))){ formattedValue = this.filter(this.format(filteredValue, this.constraints)); }else{ formattedValue = ''; } } } if(formattedValue != null && formattedValue != undefined && ((typeof formattedValue) != "number" || !isNaN(formattedValue)) && this.textbox.value != formattedValue){ this.textbox.value = formattedValue; } this.inherited(arguments, [filteredValue, priorityChange]); }, // displayedValue: String // For subclasses like ComboBox where the displayed value // (ex: Kentucky) and the serialized value (ex: KY) are different, // this represents the displayed value. // // Setting 'displayedValue' through attr('displayedValue', ...) // updates 'value', and vice-versa. Othewise 'value' is updated // from 'displayedValue' periodically, like onBlur etc. // // TODO: move declaration to MappedTextBox? // Problem is that ComboBox references displayedValue, // for benefit of FilteringSelect. displayedValue: "", getDisplayedValue: function(){ // summary: // Deprecated. Use attr('displayedValue') instead. // tags: // deprecated dojo.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use attr('displayedValue') instead.", "", "2.0"); return this.attr('displayedValue'); }, _getDisplayedValueAttr: function(){ // summary: // Hook so attr('displayedValue') works. // description: // Returns the displayed value (what the user sees on the screen), // after filtering (ie, trimming spaces etc.). // // For some subclasses of TextBox (like ComboBox), the displayed value // is different from the serialized value that's actually // sent to the server (see dijit.form.ValidationTextBox.serialize) return this.filter(this.textbox.value); }, setDisplayedValue: function(/*String*/value){ // summary: // Deprecated. Use attr('displayedValue', ...) instead. // tags: // deprecated dojo.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use attr('displayedValue', ...) instead.", "", "2.0"); this.attr('displayedValue', value); }, _setDisplayedValueAttr: function(/*String*/value){ // summary: // Hook so attr('displayedValue', ...) works. // description: // Sets the value of the visual element to the string "value". // The widget value is also set to a corresponding, // but not necessarily the same, value. if(value === null || value === undefined){ value = '' } else if(typeof value != "string"){ value = String(value) } this.textbox.value = value; this._setValueAttr(this.attr('value'), undefined, value); }, format: function(/* String */ value, /* Object */ constraints){ // summary: // Replacable function to convert a value to a properly formatted string. // tags: // protected extension return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value)); }, parse: function(/* String */ value, /* Object */ constraints){ // summary: // Replacable function to convert a formatted string to a value // tags: // protected extension return value; // String }, _refreshState: function(){ // summary: // After the user types some characters, etc., this method is // called to check the field for validity etc. The base method // in `dijit.form.TextBox` does nothing, but subclasses override. // tags: // protected }, _onInput: function(e){ if(e && e.type && /key/i.test(e.type) && e.keyCode){ switch(e.keyCode){ case dojo.keys.SHIFT: case dojo.keys.ALT: case dojo.keys.CTRL: case dojo.keys.TAB: return; } } if(this.intermediateChanges){ var _this = this; // the setTimeout allows the key to post to the widget input box setTimeout(function(){ _this._handleOnChange(_this.attr('value'), false); }, 0); } this._refreshState(); }, postCreate: function(){ // setting the value here is needed since value="" in the template causes "undefined" // and setting in the DOM (instead of the JS object) helps with form reset actions this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same this.inherited(arguments); if(dojo.isMoz || dojo.isOpera){ this.connect(this.textbox, "oninput", this._onInput); }else{ this.connect(this.textbox, "onkeydown", this._onInput); this.connect(this.textbox, "onkeyup", this._onInput); this.connect(this.textbox, "onpaste", this._onInput); this.connect(this.textbox, "oncut", this._onInput); } /*#5297:if(this.srcNodeRef){ dojo.style(this.textbox, "cssText", this.style); this.textbox.className += " " + this["class"]; }*/ this._layoutHack();";s:7:"returns";s:6:"String";s:7:"summary";s:0:"";}s:30:"dijit.form.TextBox._blankValue";a:3:{s:9:"prototype";s:18:"dijit.form.TextBox";s:7:"private";b:1;s:7:"summary";s:0:"";}s:25:"dijit.form.TextBox.filter";a:7:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"val";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:423:" if(val === null){ return this._blankValue; } if(typeof val != "string"){ return val; } if(this.trim){ val = dojo.trim(val); } if(this.uppercase){ val = val.toUpperCase(); } if(this.lowercase){ val = val.toLowerCase(); } if(this.propercase){ val = val.replace(/[^\s]+/g, function(word){ return word.substring(0,1).toUpperCase() + word.substring(1); }); } return val;";s:7:"summary";s:93:"Auto-corrections (such as trimming) that are applied to textbox value on blur or form submit.";s:11:"description";s:429:"For MappedTextBox subclasses, this is called twice - once with the display value - once the value as set/returned by attr('value', ...) and attr('value'), ex: a Number for NumberTextBox. In the latter case it does corrections like converting null to NaN. In the former case the NumberTextBox.filter() method calls this.inherited() to execute standard trimming code in TextBox.filter(). TODO: break this into two methods in 2.0";s:4:"tags";s:19:"protected extension";}s:32:"dijit.form.TextBox._setBlurValue";a:5:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:48:" this._setValueAttr(this.attr('value'), true);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:26:"dijit.form.TextBox._onBlur";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:86:" if(this.disabled){ return; } this._setBlurValue(); this.inherited(arguments);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"dijit.form.TextBox._onFocus";a:6:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:86:" if(this.disabled){ return; } this._refreshState(); this.inherited(arguments);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:24:"dijit.form.TextBox.reset";a:5:{s:9:"prototype";s:18:"dijit.form.TextBox";s:4:"type";s:8:"Function";s:6:"source";s:9110:"dojo.provide("dijit.form.TextBox"); dojo.require("dijit.form._FormWidget"); dojo.declare( "dijit.form.TextBox", dijit.form._FormValueWidget, { // summary: // A base class for textbox form inputs // trim: Boolean // Removes leading and trailing whitespace if true. Default is false. trim: false, // uppercase: Boolean // Converts all characters to uppercase if true. Default is false. uppercase: false, // lowercase: Boolean // Converts all characters to lowercase if true. Default is false. lowercase: false, // propercase: Boolean // Converts the first character of each word to uppercase if true. propercase: false, // maxLength: String // HTML INPUT tag maxLength declaration. maxLength: "", templatePath: dojo.moduleUrl("dijit.form", "templates/TextBox.html"), baseClass: "dijitTextBox", attributeMap: dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap, { maxLength: "focusNode" }), _getValueAttr: function(){ // summary: // Hook so attr('value') works as we like. // description: // For `dijit.form.TextBox` this basically returns the value of the . // // For `dijit.form.MappedTextBox` subclasses, which have both // a "displayed value" and a separate "submit value", // This treats the "displayed value" as the master value, computing the // submit value from it via this.parse(). return this.parse(this.attr('displayedValue'), this.constraints); }, _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){ // summary: // Hook so attr('value', ...) works. // // description: // Sets the value of the widget to "value" which can be of // any type as determined by the widget. // // value: // The visual element value is also set to a corresponding, // but not necessarily the same, value. // // formattedValue: // If specified, used to set the visual element value, // otherwise a computed visual value is used. // // priorityChange: // If true, an onChange event is fired immediately instead of // waiting for the next blur event. var filteredValue; if(value !== undefined){ // TODO: this is calling filter() on both the display value and the actual value. // I added a comment to the filter() definition about this, but it should be changed. filteredValue = this.filter(value); if(typeof formattedValue != "string"){ if(filteredValue !== null && ((typeof filteredValue != "number") || !isNaN(filteredValue))){ formattedValue = this.filter(this.format(filteredValue, this.constraints)); }else{ formattedValue = ''; } } } if(formattedValue != null && formattedValue != undefined && ((typeof formattedValue) != "number" || !isNaN(formattedValue)) && this.textbox.value != formattedValue){ this.textbox.value = formattedValue; } this.inherited(arguments, [filteredValue, priorityChange]); }, // displayedValue: String // For subclasses like ComboBox where the displayed value // (ex: Kentucky) and the serialized value (ex: KY) are different, // this represents the displayed value. // // Setting 'displayedValue' through attr('displayedValue', ...) // updates 'value', and vice-versa. Othewise 'value' is updated // from 'displayedValue' periodically, like onBlur etc. // // TODO: move declaration to MappedTextBox? // Problem is that ComboBox references displayedValue, // for benefit of FilteringSelect. displayedValue: "", getDisplayedValue: function(){ // summary: // Deprecated. Use attr('displayedValue') instead. // tags: // deprecated dojo.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use attr('displayedValue') instead.", "", "2.0"); return this.attr('displayedValue'); }, _getDisplayedValueAttr: function(){ // summary: // Hook so attr('displayedValue') works. // description: // Returns the displayed value (what the user sees on the screen), // after filtering (ie, trimming spaces etc.). // // For some subclasses of TextBox (like ComboBox), the displayed value // is different from the serialized value that's actually // sent to the server (see dijit.form.ValidationTextBox.serialize) return this.filter(this.textbox.value); }, setDisplayedValue: function(/*String*/value){ // summary: // Deprecated. Use attr('displayedValue', ...) instead. // tags: // deprecated dojo.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use attr('displayedValue', ...) instead.", "", "2.0"); this.attr('displayedValue', value); }, _setDisplayedValueAttr: function(/*String*/value){ // summary: // Hook so attr('displayedValue', ...) works. // description: // Sets the value of the visual element to the string "value". // The widget value is also set to a corresponding, // but not necessarily the same, value. if(value === null || value === undefined){ value = '' } else if(typeof value != "string"){ value = String(value) } this.textbox.value = value; this._setValueAttr(this.attr('value'), undefined, value); }, format: function(/* String */ value, /* Object */ constraints){ // summary: // Replacable function to convert a value to a properly formatted string. // tags: // protected extension return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value)); }, parse: function(/* String */ value, /* Object */ constraints){ // summary: // Replacable function to convert a formatted string to a value // tags: // protected extension return value; // String }, _refreshState: function(){ // summary: // After the user types some characters, etc., this method is // called to check the field for validity etc. The base method // in `dijit.form.TextBox` does nothing, but subclasses override. // tags: // protected }, _onInput: function(e){ if(e && e.type && /key/i.test(e.type) && e.keyCode){ switch(e.keyCode){ case dojo.keys.SHIFT: case dojo.keys.ALT: case dojo.keys.CTRL: case dojo.keys.TAB: return; } } if(this.intermediateChanges){ var _this = this; // the setTimeout allows the key to post to the widget input box setTimeout(function(){ _this._handleOnChange(_this.attr('value'), false); }, 0); } this._refreshState(); }, postCreate: function(){ // setting the value here is needed since value="" in the template causes "undefined" // and setting in the DOM (instead of the JS object) helps with form reset actions this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same this.inherited(arguments); if(dojo.isMoz || dojo.isOpera){ this.connect(this.textbox, "oninput", this._onInput); }else{ this.connect(this.textbox, "onkeydown", this._onInput); this.connect(this.textbox, "onkeyup", this._onInput); this.connect(this.textbox, "onpaste", this._onInput); this.connect(this.textbox, "oncut", this._onInput); } /*#5297:if(this.srcNodeRef){ dojo.style(this.textbox, "cssText", this.style); this.textbox.className += " " + this["class"]; }*/ this._layoutHack(); }, _blankValue: '', // if the textbox is blank, what value should be reported filter: function(val){ // summary: // Auto-corrections (such as trimming) that are applied to textbox // value on blur or form submit. // description: // For MappedTextBox subclasses, this is called twice // - once with the display value // - once the value as set/returned by attr('value', ...) // and attr('value'), ex: a Number for NumberTextBox. // // In the latter case it does corrections like converting null to NaN. In // the former case the NumberTextBox.filter() method calls this.inherited() // to execute standard trimming code in TextBox.filter(). // // TODO: break this into two methods in 2.0 // // tags: // protected extension if(val === null){ return this._blankValue; } if(typeof val != "string"){ return val; } if(this.trim){ val = dojo.trim(val); } if(this.uppercase){ val = val.toUpperCase(); } if(this.lowercase){ val = val.toLowerCase(); } if(this.propercase){ val = val.replace(/[^\s]+/g, function(word){ return word.substring(0,1).toUpperCase() + word.substring(1); }); } return val; }, _setBlurValue: function(){ this._setValueAttr(this.attr('value'), true); }, _onBlur: function(e){ if(this.disabled){ return; } this._setBlurValue(); this.inherited(arguments); }, _onFocus: function(e){ if(this.disabled){ return; } this._refreshState(); this.inherited(arguments); }, reset: function(){ // Overrides dijit._FormWidget.reset(). // Additionally resets the displayed textbox value to '' this.textbox.value = ''; this.inherited(arguments);";s:7:"returns";s:6:"String";s:7:"summary";s:0:"";}s:32:"dijit.form.TextBox.textbox.value";a:2:{s:8:"instance";s:18:"dijit.form.TextBox";s:7:"summary";s:0:"";}s:21:"dijit.selectInputText";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:7:"element";a:1:{s:4:"type";s:7:"DomNode";}s:5:"start";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Number";}s:4:"stop";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Number";}}s:6:"source";s:10068:"dojo.provide("dijit.form.TextBox"); dojo.require("dijit.form._FormWidget"); dojo.declare( "dijit.form.TextBox", dijit.form._FormValueWidget, { // summary: // A base class for textbox form inputs // trim: Boolean // Removes leading and trailing whitespace if true. Default is false. trim: false, // uppercase: Boolean // Converts all characters to uppercase if true. Default is false. uppercase: false, // lowercase: Boolean // Converts all characters to lowercase if true. Default is false. lowercase: false, // propercase: Boolean // Converts the first character of each word to uppercase if true. propercase: false, // maxLength: String // HTML INPUT tag maxLength declaration. maxLength: "", templatePath: dojo.moduleUrl("dijit.form", "templates/TextBox.html"), baseClass: "dijitTextBox", attributeMap: dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap, { maxLength: "focusNode" }), _getValueAttr: function(){ // summary: // Hook so attr('value') works as we like. // description: // For `dijit.form.TextBox` this basically returns the value of the . // // For `dijit.form.MappedTextBox` subclasses, which have both // a "displayed value" and a separate "submit value", // This treats the "displayed value" as the master value, computing the // submit value from it via this.parse(). return this.parse(this.attr('displayedValue'), this.constraints); }, _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){ // summary: // Hook so attr('value', ...) works. // // description: // Sets the value of the widget to "value" which can be of // any type as determined by the widget. // // value: // The visual element value is also set to a corresponding, // but not necessarily the same, value. // // formattedValue: // If specified, used to set the visual element value, // otherwise a computed visual value is used. // // priorityChange: // If true, an onChange event is fired immediately instead of // waiting for the next blur event. var filteredValue; if(value !== undefined){ // TODO: this is calling filter() on both the display value and the actual value. // I added a comment to the filter() definition about this, but it should be changed. filteredValue = this.filter(value); if(typeof formattedValue != "string"){ if(filteredValue !== null && ((typeof filteredValue != "number") || !isNaN(filteredValue))){ formattedValue = this.filter(this.format(filteredValue, this.constraints)); }else{ formattedValue = ''; } } } if(formattedValue != null && formattedValue != undefined && ((typeof formattedValue) != "number" || !isNaN(formattedValue)) && this.textbox.value != formattedValue){ this.textbox.value = formattedValue; } this.inherited(arguments, [filteredValue, priorityChange]); }, // displayedValue: String // For subclasses like ComboBox where the displayed value // (ex: Kentucky) and the serialized value (ex: KY) are different, // this represents the displayed value. // // Setting 'displayedValue' through attr('displayedValue', ...) // updates 'value', and vice-versa. Othewise 'value' is updated // from 'displayedValue' periodically, like onBlur etc. // // TODO: move declaration to MappedTextBox? // Problem is that ComboBox references displayedValue, // for benefit of FilteringSelect. displayedValue: "", getDisplayedValue: function(){ // summary: // Deprecated. Use attr('displayedValue') instead. // tags: // deprecated dojo.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use attr('displayedValue') instead.", "", "2.0"); return this.attr('displayedValue'); }, _getDisplayedValueAttr: function(){ // summary: // Hook so attr('displayedValue') works. // description: // Returns the displayed value (what the user sees on the screen), // after filtering (ie, trimming spaces etc.). // // For some subclasses of TextBox (like ComboBox), the displayed value // is different from the serialized value that's actually // sent to the server (see dijit.form.ValidationTextBox.serialize) return this.filter(this.textbox.value); }, setDisplayedValue: function(/*String*/value){ // summary: // Deprecated. Use attr('displayedValue', ...) instead. // tags: // deprecated dojo.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use attr('displayedValue', ...) instead.", "", "2.0"); this.attr('displayedValue', value); }, _setDisplayedValueAttr: function(/*String*/value){ // summary: // Hook so attr('displayedValue', ...) works. // description: // Sets the value of the visual element to the string "value". // The widget value is also set to a corresponding, // but not necessarily the same, value. if(value === null || value === undefined){ value = '' } else if(typeof value != "string"){ value = String(value) } this.textbox.value = value; this._setValueAttr(this.attr('value'), undefined, value); }, format: function(/* String */ value, /* Object */ constraints){ // summary: // Replacable function to convert a value to a properly formatted string. // tags: // protected extension return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value)); }, parse: function(/* String */ value, /* Object */ constraints){ // summary: // Replacable function to convert a formatted string to a value // tags: // protected extension return value; // String }, _refreshState: function(){ // summary: // After the user types some characters, etc., this method is // called to check the field for validity etc. The base method // in `dijit.form.TextBox` does nothing, but subclasses override. // tags: // protected }, _onInput: function(e){ if(e && e.type && /key/i.test(e.type) && e.keyCode){ switch(e.keyCode){ case dojo.keys.SHIFT: case dojo.keys.ALT: case dojo.keys.CTRL: case dojo.keys.TAB: return; } } if(this.intermediateChanges){ var _this = this; // the setTimeout allows the key to post to the widget input box setTimeout(function(){ _this._handleOnChange(_this.attr('value'), false); }, 0); } this._refreshState(); }, postCreate: function(){ // setting the value here is needed since value="" in the template causes "undefined" // and setting in the DOM (instead of the JS object) helps with form reset actions this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same this.inherited(arguments); if(dojo.isMoz || dojo.isOpera){ this.connect(this.textbox, "oninput", this._onInput); }else{ this.connect(this.textbox, "onkeydown", this._onInput); this.connect(this.textbox, "onkeyup", this._onInput); this.connect(this.textbox, "onpaste", this._onInput); this.connect(this.textbox, "oncut", this._onInput); } /*#5297:if(this.srcNodeRef){ dojo.style(this.textbox, "cssText", this.style); this.textbox.className += " " + this["class"]; }*/ this._layoutHack(); }, _blankValue: '', // if the textbox is blank, what value should be reported filter: function(val){ // summary: // Auto-corrections (such as trimming) that are applied to textbox // value on blur or form submit. // description: // For MappedTextBox subclasses, this is called twice // - once with the display value // - once the value as set/returned by attr('value', ...) // and attr('value'), ex: a Number for NumberTextBox. // // In the latter case it does corrections like converting null to NaN. In // the former case the NumberTextBox.filter() method calls this.inherited() // to execute standard trimming code in TextBox.filter(). // // TODO: break this into two methods in 2.0 // // tags: // protected extension if(val === null){ return this._blankValue; } if(typeof val != "string"){ return val; } if(this.trim){ val = dojo.trim(val); } if(this.uppercase){ val = val.toUpperCase(); } if(this.lowercase){ val = val.toLowerCase(); } if(this.propercase){ val = val.replace(/[^\s]+/g, function(word){ return word.substring(0,1).toUpperCase() + word.substring(1); }); } return val; }, _setBlurValue: function(){ this._setValueAttr(this.attr('value'), true); }, _onBlur: function(e){ if(this.disabled){ return; } this._setBlurValue(); this.inherited(arguments); }, _onFocus: function(e){ if(this.disabled){ return; } this._refreshState(); this.inherited(arguments); }, reset: function(){ // Overrides dijit._FormWidget.reset(). // Additionally resets the displayed textbox value to '' this.textbox.value = ''; this.inherited(arguments); } } ); dijit.selectInputText = function(/*DomNode*/element, /*Number?*/ start, /*Number?*/ stop){ // summary: // Select text in the input element argument, from start (default 0), to stop (default end). // TODO: use functions in _editor/selection.js? var _window = dojo.global; var _document = dojo.doc; element = dojo.byId(element); if(isNaN(start)){ start = 0; } if(isNaN(stop)){ stop = element.value ? element.value.length : 0; } element.focus(); if(_document["selection"] && dojo.body()["createTextRange"]){ // IE if(element.createTextRange){ var range = element.createTextRange(); with(range){ collapse(true); moveStart("character", start); moveEnd("character", stop); select(); } } }else if(_window["getSelection"]){ var selection = _window.getSelection(); // TODO: unused, remove // FIXME: does this work on Safari? if(element.setSelectionRange){ element.setSelectionRange(start, stop); } }";s:7:"returns";s:6:"String";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:"";}}