Type.registerNamespace("Telerik.Web.UI");
function GetRadSpell(a){return $find(a);
}$telerik.toSpell=function(a){return a;
};
$telerik.findSpell=$find;
Telerik.Web.UI.RadSpell=function(a){Telerik.Web.UI.RadSpell.initializeBase(this,[a]);
this._dictionaryLanguage=null;
this._languagesDropDown=null;
this._textSource=null;
this._controlToCheck=null;
this._controlsToCheck=null;
this._ajaxUrl=null;
this._clientTextSource=null;
};
Telerik.Web.UI.RadSpell.prototype={initialize:function(){Telerik.Web.UI.RadSpell.callBaseMethod(this,"initialize");
this._languagesDropDown=this._getChildElement("Language");
this._spellCheckButton=this._getChildElement("SpellCheck");
if(this._spellCheckButton){$addHandlers(this._spellCheckButton,{click:this.startSpellCheck},this);
if(this._spellCheckButton.tagName&&this._spellCheckButton.tagName.toLowerCase()!="input"){$addHandlers(this._spellCheckButton,{keypress:this.startSpellCheck},this);
}}this.set_spellChecked(false);
this.add_clientCheckFinished(this.checkFinishedHandler);
this.add_clientCheckStarted(this.checkStartedHandler);
this.raiseEvent("load",Sys.EventArgs.Empty);
},dispose:function(){this._controlToCheck=null;
this._controlsToCheck=null;
this._dialogOpener=null;
if(this._spellCheckButton){$clearHandlers(this._spellCheckButton);
}this.remove_clientCheckFinished(this.checkFinishedHandler);
this.remove_clientCheckStarted(this.checkStartedHandler);
Telerik.Web.UI.RadSpell.callBaseMethod(this,"dispose");
},checkFinishedHandler:function(a,b){a.set_spellChecked(true);
},checkStartedHandler:function(a,b){a.set_spellChecked(false);
},startSpellCheck:function(){var a=this.get_textSource();
if(a!=null){this.spellCheck(a);
}else{alert("Cannot find a TextSource. Please, set the ControlToCheck server-side property, or use the SetTextSource() client-side method.");
}},spellCheck:function(a){var b=new Sys.CancelEventArgs();
this.raiseEvent("clientCheckStarted",b);
if(!b.get_cancel()){var c={dictionaryLanguage:this.get_selectedLanguage(),textSource:a,spell:this};
this.get_dialogOpener().open("SpellCheckDialog",c);
}},get_selectedLanguage:function(){if(this.get_dictionaryLanguage()){return this.get_dictionaryLanguage();
}if(!this._languagesDropDown){return null;
}var a=this._languagesDropDown.options[this._languagesDropDown.selectedIndex];
return a!=null?a.value:null;
},_createElementSource:function(b){var c=null;
var a=$find(b);
if(a&&Telerik.Web.UI.RadWebControl.isInstanceOfType(a)){c=$create(Telerik.Web.UI.Spell.RadControlTextSource,{element:a},null,null);
}else{c=$create(Telerik.Web.UI.Spell.HtmlElementTextSource,{element:$get(b)},null,null);
}return c;
},get_textSource:function(){if(this._textSource==null){if(null!=this.get_controlsToCheck()&&this.get_controlsToCheck().length>0){var c=[];
var b=this.get_controlsToCheck();
for(var a=0;
a/g,">").replace(/<");
}}return b;
},set_text:function(b){var a=this.get_element();
if(!a||null==b){return;
}if(a.set_html){a.set_html(b);
}else{if(!this.get_checkTextAsHtml()){b=b.replace(/</gi,"<").replace(/>/gi,">");
}if(a.set_text){a.set_text(b);
}else{if(a.set_value){a.set_value(b);
}else{alert("Cannot access text of RadControl.");
}}}}};
Telerik.Web.UI.Spell.RadControlTextSource.registerClass("Telerik.Web.UI.Spell.RadControlTextSource",Telerik.Web.UI.Spell.HtmlTextSourceBase);
Telerik.Web.UI.Spell.HtmlElementTextSource=function(a){Telerik.Web.UI.Spell.HtmlElementTextSource.initializeBase(this,[a]);
};
Telerik.Web.UI.Spell.HtmlElementTextSource.prototype={initialize:function(){Telerik.Web.UI.Spell.HtmlElementTextSource.callBaseMethod(this,"initialize");
var a=this.get_element();
if(a==null){alert("Could not find target HTML element. Please verify that ControlToCheck/ControlsToCheck points to valid HTML controls.");
this.set_element({value:""});
}else{if(a.nodeName=="IFRAME"&&a.contentWindow!=null){this.set_element(a.contentWindow.document.body);
}}a=null;
},get_text:function(){var a="";
if(this.get_element().value!=null){try{a=this.get_element().value;
}catch(b){alert("Error getting text from control.\n"+b.message);
}if(!this.get_checkTextAsHtml()){a=a.replace(//g,">").replace(/<");
}}else{if(this.get_element().innerHTML!=null){try{a=this.get_element().innerHTML;
}catch(b){alert("Error getting HTML from the control.\n"+b.message);
}}else{alert("No value or innerHTML attribute. Cannot access text.");
}}return a;
},set_text:function(a){if(this.get_element()==null){return;
}if(this.get_element().value!=null){if(!this.get_checkTextAsHtml()){a=a.replace(/</gi,"<").replace(/>/gi,">");
}this.get_element().value=a;
}else{if(this.get_element().innerHTML!=null){this.get_element().innerHTML=a;
}else{alert("No value or innerHTML attribute. Cannot access text.");
}}}};
Telerik.Web.UI.Spell.HtmlElementTextSource.registerClass("Telerik.Web.UI.Spell.HtmlElementTextSource",Telerik.Web.UI.Spell.HtmlTextSourceBase);
Telerik.Web.UI.Spell.MultipleHtmlElementsSource=function(a){Telerik.Web.UI.Spell.MultipleHtmlElementsSource.initializeBase(this);
this._elements=a;
};
Telerik.Web.UI.Spell.MultipleHtmlElementsSource.prototype={initialize:function(){Telerik.Web.UI.Spell.MultipleHtmlElementsSource.callBaseMethod(this,"initialize");
},dispose:function(){this._elements=null;
Telerik.Web.UI.Spell.MultipleHtmlElementsSource.callBaseMethod(this,"dispose");
},get_text:function(){var b=[];
for(var a=0;
a
");
},set_text:function(c){var a=c.split("
");
for(var b=0;
b