RadSpell was only partially ported in RadControls Prometheus and that's why
it was not included in the official Q2 release. The samples below demonstrates
how to use the "old" RadSpell with RadEditor Prometheus:
external button
<div>
<asp:scriptmanager id="ScriptManager1" runat="server" />
<rads:radspell id="RadSpell1" runat="server" controltocheck="RadEditor1" />
<telerik:radeditor runat="server" id="RadEditor1">
<content>
There are somee miztakes in this text
</content>
</telerik:radeditor>
<script type="text/javascript">
var _htmlElementTextSource = HtmlElementTextSource;
var PrometheusTextSource = function(editor)
{
this._editor = editor;
this.GetText = function() { return this._editor.get_Html(); };
this.SetText = function(value) { this._editor.set_Html(value); };
}
HtmlElementTextSource = function(element)
{
this.source = element.control && element.control.get_Html ? new PrometheusTextSource(element.control) : new _htmlElementTextSource(element);
this.GetText = function() { return this.source.GetText(); };
this.SetText = function(value) { return this.source.SetText(value); };
}
</script>
</div>
<div>
<asp:scriptmanager id="ScriptManager1" runat="server" />
<rads:radspell id="RadSpell1" runat="server" controltocheck="RadEditor1" />
<telerik:radeditor runat="server" id="RadEditor1">
<content>
There are somee miztakes in this text
</content>
</telerik:radeditor>
<script type="text/javascript">
var _htmlElementTextSource = HtmlElementTextSource;
var PrometheusTextSource = function(editor)
{
this._editor = editor;
this.GetText = function() { return this._editor.get_Html(); };
this.SetText = function(value) { this._editor.set_Html(value); };
}
HtmlElementTextSource = function(element)
{
this.source = element.control && element.control.get_Html ? new PrometheusTextSource(element.control) : new _htmlElementTextSource(element);
this.GetText = function() { return this.source.GetText(); };
this.SetText = function(value) { return this.source.SetText(value); };
}
</script>
</div>
example with a custom tool
<div>
<asp:scriptmanager id="ScriptManager1" runat="server" />
<rads:radspell id="RadSpell1" runat="server" buttontype="none" />
<telerik:radeditor runat="server" id="RadEditor1">
<tools>
<telerik:editortoolgroup>
<telerik:editortool name="spellcheck" />
</telerik:editortoolgroup>
</tools>
<content>
There are somee miztakes in this text
</content>
</telerik:radeditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList.SpellCheck = function(commandName, editor)
{
var spell = GetRadSpell('<%= RadSpell1.ClientID %>');
spell.SpellCheck(new PrometheusTextSource(editor));
return false;
}
var PrometheusTextSource = function(editor)
{
this._editor = editor;
this.GetText = function() { return this._editor.get_Html(); };
this.SetText = function(value) { this._editor.set_Html(value); };
}
</script>
</div>
The inline spellcheck mechanism will not be available in RadEditor "Prometheus" before SP1, which is expected in a couple of weeks.
