/*
	Copyright (c) 2004-2011, 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
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.mobile.app.TextBox"],["require","dojox.mobile.app._Widget"],["require","dojox.mobile.app._FormWidget"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.mobile.app.TextBox"]){_4._hasResource["dojox.mobile.app.TextBox"]=true;_4.provide("dojox.mobile.app.TextBox");_4.experimental("dojox.mobile.app.TextBox");_4.require("dojox.mobile.app._Widget");_4.require("dojox.mobile.app._FormWidget");_4.declare("dojox.mobile.app.TextBox",_6.mobile.app._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",baseClass:"mblTextBox",attributeMap:_4.delegate(_6.mobile.app._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),buildRendering:function(){var _7=this.srcNodeRef;if(!_7||_7.tagName!="INPUT"){_7=_4.create("input",{});}_4.attr(_7,{type:"text",value:_4.attr(_7,"value")||"",placeholder:this.placeHolder||null});this.domNode=this.textbox=this.focusNode=_7;},_setPlaceHolderAttr:function(v){this.placeHolder=v;if(this.textbox){_4.attr(this.textbox,"placeholder",v);}},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints);},_setValueAttr:function(_8,_9,_a){var _b;if(_8!==undefined){_b=this.filter(_8);if(typeof _a!="string"){if(_b!==null&&((typeof _b!="number")||!isNaN(_b))){_a=this.filter(this.format(_b,this.constraints));}else{_a="";}}}if(_a!=null&&_a!=undefined&&((typeof _a)!="number"||!isNaN(_a))&&this.textbox.value!=_a){this.textbox.value=_a;}this.inherited(arguments,[_b,_9]);},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value);},_setDisplayedValueAttr:function(_c){if(_c===null||_c===undefined){_c="";}else{if(typeof _c!="string"){_c=String(_c);}}this.textbox.value=_c;this._setValueAttr(this.get("value"),undefined,_c);},format:function(_d,_e){return ((_d==null||_d==undefined)?"":(_d.toString?_d.toString():_d));},parse:function(_f,_10){return _f;},_refreshState:function(){},_onInput:function(e){if(e&&e.type&&/key/i.test(e.type)&&e.keyCode){switch(e.keyCode){case _4.keys.SHIFT:case _4.keys.ALT:case _4.keys.CTRL:case _4.keys.TAB:return;}}if(this.intermediateChanges){var _11=this;setTimeout(function(){_11._handleOnChange(_11.get("value"),false);},0);}this._refreshState();},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(_4.isMoz||_4.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);}},_blankValue:"",filter:function(val){if(val===null){return this._blankValue;}if(typeof val!="string"){return val;}if(this.trim){val=_4.trim(val);}if(this.uppercase){val=val.toUpperCase();}if(this.lowercase){val=val.toLowerCase();}if(this.propercase){val=val.replace(/[^\s]+/g,function(_12){return _12.substring(0,1).toUpperCase()+_12.substring(1);});}return val;},_setBlurValue:function(){this._setValueAttr(this.get("value"),true);},_onBlur:function(e){if(this.disabled){return;}this._setBlurValue();this.inherited(arguments);if(this._selectOnClickHandle){this.disconnect(this._selectOnClickHandle);}if(this.selectOnClick&&_4.isMoz){this.textbox.selectionStart=this.textbox.selectionEnd=undefined;}},_onFocus:function(by){if(this.disabled||this.readOnly){return;}if(this.selectOnClick&&by=="mouse"){this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var _13;_13=this.textbox.selectionStart==this.textbox.selectionEnd;if(_13){this.selectInputText(this.textbox);}});}this._refreshState();this.inherited(arguments);},reset:function(){this.textbox.value="";this.inherited(arguments);}});}}};});