This is a migrated thread and some comments may be shown as answers.

[Solved] Using RadSpell with RadEditor "Prometheus"

1 Answer 390 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 21 Sep 2007, 11:52 AM
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>

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.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 26 Feb 2008, 06:38 PM
Hi guys,

You can find an updated version of the provided code solution for RadEditor "Prometheus" and RadSpell "Prometheus" in the following help article: Using RadSpell "Prometheus" dialog with RadEditor "Prometheus" as a custom tool.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Answers by
Rumen
Telerik team
Share this question
or