Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.FilteredTextBoxBehavior=function(c){var b=null,a=this;AjaxControlToolkit.FilteredTextBoxBehavior.initializeBase(a,[c]);a._keypressHandler=b;a._changeHandler=b;a._intervalID=b;a._filterType=AjaxControlToolkit.FilterTypes.Custom;a._filterMode=AjaxControlToolkit.FilterModes.ValidChars;a._validChars=b;a._invalidChars=b;a._filterInterval=250;a.charTypes={};a.charTypes.LowercaseLetters="abcdefghijklmnopqrstuvwxyz";a.charTypes.UppercaseLetters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a.charTypes.Numbers="0123456789"};AjaxControlToolkit.FilteredTextBoxBehavior.prototype={initialize:function(){var a=this;AjaxControlToolkit.FilteredTextBoxBehavior.callBaseMethod(a,"initialize");var b=a.get_element();a._keypressHandler=Function.createDelegate(a,a._onkeypress);$addHandler(b,"keypress",a._keypressHandler);a._changeHandler=Function.createDelegate(a,a._onchange);$addHandler(b,"change",a._changeHandler);var c=Function.createDelegate(a,a._intervalCallback);a._intervalID=window.setInterval(c,a._filterInterval)},dispose:function(){var a=this,b=a.get_element();$removeHandler(b,"keypress",a._keypressHandler);a._keypressHandler=null;$removeHandler(b,"change",a._changeHandler);a._changeHandler=null;window.clearInterval(a._intervalID);AjaxControlToolkit.FilteredTextBoxBehavior.callBaseMethod(a,"dispose")},_getValidChars:function(){var a=this;if(a._validChars)return a._validChars;a._validChars="";for(type in a.charTypes){var b=AjaxControlToolkit.FilterTypes.toString(a._filterType);if(b.indexOf(type)!=-1)a._validChars+=a.charTypes[type]}return a._validChars},_getInvalidChars:function(){var a=this;if(!a._invalidChars)a._invalidChars=a.charTypes.Custom;return a._invalidChars},_onkeypress:function(a){var b;if((a.rawEvent.charCode==0||a.rawEvent.keyCode==a.rawEvent.which&&a.rawEvent.charCode==undefined)&&(a.rawEvent.keyCode==Sys.UI.Key.pageUp||a.rawEvent.keyCode==Sys.UI.Key.pageDown||a.rawEvent.keyCode==Sys.UI.Key.up||a.rawEvent.keyCode==Sys.UI.Key.down||a.rawEvent.keyCode==Sys.UI.Key.left||a.rawEvent.keyCode==Sys.UI.Key.right||a.rawEvent.keyCode==Sys.UI.Key.home||a.rawEvent.keyCode==Sys.UI.Key.end||a.rawEvent.keyCode==46)||a.ctrlKey)return;if(a.rawEvent.keyIdentifier){if(a.rawEvent.ctrlKey||a.rawEvent.altKey||a.rawEvent.metaKey)return;if(a.rawEvent.keyIdentifier.substring(0,2)!="U+")return;b=a.rawEvent.charCode;if(b==63272)return}else b=a.charCode;if(b&&b>=32){var c=String.fromCharCode(b);!this._processKey(c)&&a.preventDefault()}},_processKey:function(c){var b=this,a="",d=false;if(b._filterMode==AjaxControlToolkit.FilterModes.ValidChars){a=b._getValidChars();d=a&&a.length>0&&a.indexOf(c)==-1}else{a=b._getInvalidChars();d=a&&a.length>0&&a.indexOf(c)>-1}var e=new AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs(c,AjaxControlToolkit.TextBoxWrapper.get_Wrapper(b.get_element()).get_Value(),d);b.raiseProcessKey(e);if(e.get_allowKey())return true;b.raiseFiltered(new AjaxControlToolkit.FilteredTextBoxEventArgs(c));return false},_onchange:function(){for(var b=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(this.get_element()),d=b.get_Value()||"",c=new Sys.StringBuilder,a=0;a Карта
rss
Карта