Type.registerNamespace("Telerik.Web.UI");
function GetRadSpell(_1){
return $find(_1);
}
Telerik.Web.UI.RadSpell=function(_2){
Telerik.Web.UI.RadSpell.initializeBase(this,[_2]);
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=$get(this.get_id()+"Language");
this._spellCheckButton=$get(this.get_id()+"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(_3,_4){
_3.set_spellChecked(true);
},checkStartedHandler:function(_5,_6){
_5.set_spellChecked(false);
},startSpellCheck:function(){
var _7=this.get_textSource();
if(_7!=null){
this.spellCheck(_7);
}else{
alert("Cannot find a TextSource. Please, set the ControlToCheck server-side property, or use the SetTextSource() client-side method.");
}
},spellCheck:function(_8){
var _9=new Sys.CancelEventArgs();
this.raiseEvent("clientCheckStarted",_9);
if(!_9.get_cancel()){
var _a={dictionaryLanguage:this.get_selectedLanguage(),textSource:_8,spell:this};
this.get_dialogOpener().open("SpellCheckDialog",_a);
}
},get_selectedLanguage:function(){
if(this.get_dictionaryLanguage()){
return this.get_dictionaryLanguage();
}
if(!this._languagesDropDown){
return null;
}
var _b=this._languagesDropDown.options[this._languagesDropDown.selectedIndex];
return _b!=null?_b.value:null;
},get_textSource:function(){
if(this._textSource==null){
if(null!=this.get_controlsToCheck()&&this.get_controlsToCheck().length>0){
var _c=[];
for(var i=0;i<this.get_controlsToCheck().length;i++){
_c[_c.length]=$create(Telerik.Web.UI.Spell.HtmlElementTextSource,{element:$get(this.get_controlsToCheck()[i])},null,null);
}
this.set_textSource($create(Telerik.Web.UI.Spell.MultipleHtmlElementsSource,{elements:_c},null,null));
}else{
if(this.get_controlToCheck()){
var _e=document.getElementById(this.get_controlToCheck());
this.set_textSource($create(Telerik.Web.UI.Spell.HtmlElementTextSource,{element:_e},null,null));
}else{
if(this.get_clientTextSource()){
this.set_textSource(eval(this.get_clientTextSource()));
}
}
}
}
return this._textSource;
},set_textSource:function(_f){
this._textSource=_f;
},get_spellChecked:function(){
return this._spellChecked;
},set_spellChecked:function(_10){
$get(this.get_id()+"SpellChecked").value=_10?"true":"";
this._spellChecked=_10;
},get_dialogOpener:function(){
return this._dialogOpener;
},set_dialogOpener:function(_11){
this._dialogOpener=_11;
},get_dictionaryLanguage:function(){
return this._dictionaryLanguage;
},set_dictionaryLanguage:function(_12){
this._dictionaryLanguage=_12;
},get_controlToCheck:function(){
return this._controlToCheck;
},set_controlToCheck:function(_13){
this._controlToCheck=_13;
},get_controlsToCheck:function(){
return this._controlsToCheck;
},set_controlsToCheck:function(_14){
this._controlsToCheck=_14;
},get_clientTextSource:function(){
return this._clientTextSource;
},set_clientTextSource:function(_15){
this._clientTextSource=_15;
},get_ajaxUrl:function(){
return this._ajaxUrl;
},set_ajaxUrl:function(_16){
this._ajaxUrl=_16;
},get_useClassicDialogs:function(){
return this.get_dialogOpener().get_useClassicDialogs();
},set_useClassicDialogs:function(_17){
this.get_dialogOpener().set_useClassicDialogs(_17);
},add_load:function(_18){
this.get_events().addHandler("load",_18);
},remove_load:function(_19){
this.get_events().removeHandler("load",_19);
},add_clientDialogClosing:function(_1a){
this.get_events().addHandler("clientDialogClosing",_1a);
},remove_clientDialogClosing:function(_1b){
this.get_events().removeHandler("clientDialogClosing",_1b);
},add_clientCheckCancelled:function(_1c){
this.get_events().addHandler("clientCheckCancelled",_1c);
},remove_clientCheckCancelled:function(_1d){
this.get_events().removeHandler("clientCheckCancelled",_1d);
},add_clientCheckFinished:function(_1e){
this.get_events().addHandler("clientCheckFinished",_1e);
},remove_clientCheckFinished:function(_1f){
this.get_events().removeHandler("clientCheckFinished",_1f);
},add_clientCheckStarted:function(_20){
this.get_events().addHandler("clientCheckStarted",_20);
},remove_clientCheckStarted:function(_21){
this.get_events().removeHandler("clientCheckStarted",_21);
}};
Telerik.Web.UI.RadSpell.registerClass("Telerik.Web.UI.RadSpell",Telerik.Web.UI.RadWebControl);
Type.registerNamespace("Telerik.Web.UI.Spell");
Telerik.Web.UI.Spell.HtmlElementTextSource=function(_22){
Telerik.Web.UI.Spell.HtmlElementTextSource.initializeBase(this);
this._element=_22;
};
Telerik.Web.UI.Spell.HtmlElementTextSource.prototype={initialize:function(){
Telerik.Web.UI.Spell.HtmlElementTextSource.callBaseMethod(this,"initialize");
var _23=this.get_element();
if(_23==null){
alert("Could not find target HTML element. Please verify that ControlToCheck/ControlsToCheck points to valid HTML controls.");
this.set_element({value:""});
}else{
if(_23.nodeName=="IFRAME"&&_23.contentWindow!=null){
this.set_element(_23.contentWindow.document.body);
}
}
_23=null;
},dispose:function(){
this._element=null;
Telerik.Web.UI.Spell.HtmlElementTextSource.callBaseMethod(this,"dispose");
},get_text:function(){
var _24="";
if(this.get_element().value!=null){
try{
_24=this.get_element().value;
}
catch(exc){
alert("Error getting text from control.\n"+exc.message);
}
}else{
if(this.get_element().innerHTML!=null){
try{
_24=this.get_element().innerHTML;
}
catch(exc){
alert("Error getting HTML from the control.\n"+exc.message);
}
}else{
alert("No value or innerHTML attribute. Cannot access text.");
}
}
return _24;
},set_text:function(_25){
if(this.get_element()==null){
return;
}
if(this.get_element().value!=null){
this.get_element().value=_25;
}else{
if(this.get_element().innerHTML!=null){
this.get_element().innerHTML=_25;
}else{
alert("No value or innerHTML attribute. Cannot access text.");
}
}
},get_element:function(){
return this._element;
},set_element:function(_26){
this._element=_26;
}};
Telerik.Web.UI.Spell.HtmlElementTextSource.registerClass("Telerik.Web.UI.Spell.HtmlElementTextSource",Sys.Component);
Telerik.Web.UI.Spell.MultipleHtmlElementsSource=function(_27){
Telerik.Web.UI.Spell.MultipleHtmlElementsSource.initializeBase(this);
this._elements=_27;
};
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 _28=[];
for(var i=0;i<this._elements.length;i++){
_28[_28.length]=this._elements[i].get_text();
}
return _28.join("<controlSeparator><br/></controlSeparator>");
},set_text:function(_2a){
var _2b=_2a.split("<controlSeparator><br/></controlSeparator>");
for(var i=0;i<this._elements.length;i++){
this._elements[i].set_text(_2b[i]);
}
},get_elements:function(){
return this._elements;
},set_elements:function(_2d){
this._elements=_2d;
}};
Telerik.Web.UI.Spell.MultipleHtmlElementsSource.registerClass("Telerik.Web.UI.Spell.MultipleHtmlElementsSource",Sys.Component);

