Type.registerNamespace("Telerik.Web.UI"); Telerik.Web.UI.SpellCheckService=function(){Telerik.Web.UI.SpellCheckService.initializeBase(this); this._url="Telerik.Web.UI.SpellCheckHandler.axd"; this._language="en-US"; this._configuration=null; }; Telerik.Web.UI.SpellCheckService.prototype={spellCheck:function(a){this._sendRequest(this._getPostData("SpellCheck",a)); },addCustomWord:function(a){this._sendRequest(this._getPostData("AddCustom",a)); },_processResponse:function(a,c){var d=a.get_statusCode(); if(a.get_responseAvailable()&&200==d&&a.get_responseData().length>0){var b=a.get_object(); if(b.badWords!=null){b.badWords=eval(b.badWords); }if(b.wordOffsets!=null){b.wordOffsets=eval(b.wordOffsets); }this.raise_complete(a.get_object()); }else{if(a.get_timedOut()){alert("Spell Check Request time out"); }else{if(a.get_aborted()){alert("Spell Check Request aborted"); }else{if(404==d){window.alert("Web.config registration missing!\n The spellchecking functionality requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information.\n\n"+this.get_url()); }else{if(d>0&&d!=200){window.alert("Spell Check Handler Server Error:"+d+"\n"+a.get_responseData()); }}}}}},_sendRequest:function(a,c){var b=new Sys.Net.WebRequest(); b.set_url(this.get_url()); b.set_httpVerb("POST"); b.set_body(a); b.add_completed(Function.createDelegate(this,this._processResponse)); b.invoke(); },_getPostData:function(a,b){return"DictionaryLanguage="+this._encode(this._language)+"&Configuration="+this._encode(this._configuration)+"&CommandArgument="+this.encodePostbackContent(b).replace(/%/g,"~")+"&CommandName="+a; },_encode:function(a){var b=true; try{var d=$telerik.isIE?document.charset:document.characterSet; d=d+""; if(d&&d.toLowerCase().indexOf("utf")==-1){b=false; }}catch(c){}return(encodeURIComponent&&b)?encodeURIComponent(a):escape(a); },initialize:function(){Telerik.Web.UI.SpellCheckService.callBaseMethod(this,"initialize"); },dispose:function(){Telerik.Web.UI.SpellCheckService.callBaseMethod(this,"dispose"); },get_url:function(){return this._url; },set_url:function(a){this._url=a; },get_language:function(){return this._language; },set_language:function(a){this._language=a; },get_configuration:function(){return this._configuration; },set_configuration:function(a){this._configuration=a; },add_complete:function(a){this.get_events().addHandler("complete",a); },remove_complete:function(a){this.get_events().removeHandler("complete",a); },raise_complete:function(b){var a=this.get_events().getHandler("complete"); if(a){if(!b){b=Sys.EventArgs.Empty; }a(this,b); }},_encodeHtmlContent:function(b,a){var d=new Array("%","<",">","!",'"',"#","$","&","'","(",")",",",":",";","=","?","[","]","\\","^","`","{","|","}","~","+"); var c=b; var e; if(a){for(e=0; e=0; e--){c=c.replace(new RegExp("%"+d[e].charCodeAt(0).toString(16),"ig"),d[e]); }}return c; },encodePostbackContent:function(a){return this._encodeHtmlContent(a,true); },decodePostbackContent:function(a){return this._encodeHtmlContent(a,false); }}; Telerik.Web.UI.SpellCheckService.registerClass("Telerik.Web.UI.SpellCheckService",Sys.Component); if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();