|
Rank: Guest
Groups:
Joined: 2/14/2015 Posts: 1,322
|
Hi. Is it possible to use inline spell checker together with the new CKEditor? I am struggling to make it work. IF yes, can somebody provide a sample how to do it? Thanks.
Regards,
Piotr
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 10/20/2004 Posts: 456
|
Hi Piotr, Please see this knowledge base article, http://keyoti.com/kb/Def...ew&questId=123&catId=56
I replied to your email also. Should you have any trouble please let us know. Dan Dan Wright
|
|
Rank: Member
Groups: Registered
Joined: 2/12/2014 Posts: 20
|
Hi,
I am trying to use the RapidSpell for ASP .NET with the CKEditor in an MVC Web Application. I think I understand the use of the RapidSpellWInline in a traditional aspx page, but I am not sure how to use it inside an MVC (Razor) page that already has the CKEditor on it.
|
|
Rank: Member
Groups: Registered
Joined: 4/22/2006 Posts: 216
|
Hi, are you using v4? With v4 you just use Javascript on your page, so it doesn't matter if you have MVC - it's all the same. -Harry -Harry
|
|
Rank: Member
Groups: Registered
Joined: 2/12/2014 Posts: 20
|
Can you please show me an example. I have the latest version installed. Code: <div id="btnSpellCheck" > <input type="button" onclick="rapidSpell.dialog_spellCheck(true, "cke_contents_Model_NoteText")" value="Spell Check" /> </div>
But the Text Area that has the CK Editor on it does not trigger the spell check.
|
|
Rank: Member
Groups: Registered
Joined: 4/22/2006 Posts: 216
|
Sure, here's a complete HTML page that shows it working - note that you might want to update your scripts/css to the latest release (it was made today) http://keyoti.com/downlo...Web-NET-4-3-2-Setup.msi
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="/ckeditor_files/ckeditor.js"></script> <script src="/Keyoti_RapidSpell_Web_Common/RapidSpell-AYT.js"></script> <script src="/Keyoti_RapidSpell_Web_Common/RapidSpell-DIALOG.js"></script> <script type="text/javascript">
rapidSpell.ayt_staticMode = true; rapidSpell.ayt_aytEnabled = false;
function spell(id, mode) { rapidSpell.setParameterValue('default', 'IgnoreXML', true); var ifr = document.getElementsByClassName('cke_wysiwyg_frame cke_reset')[0]; ifr.setAttribute('id', id+'_ifr'); ifr.id = id+'_ifr';
if (mode == 'inline') rapidSpell.ayt_spellCheck(id + '_ifr') else { rapidSpell.dialog_spellCheck(true, id + '_ifr') } }
window.onload = function () { CKEDITOR.replace('editor1'); }; </script> </head> <body> <form> <textarea name="editor1"><p>Initial value.</p></textarea> <input type="button" onclick="spell('editor1', 'inline')" value = 'Inline spell check' /> <input type=button onclick="spell('editor1', 'dialog')" value='Dialog spell check' /> </form> </body> </html>
There is an important part to it Code: var ifr = document.getElementsByClassName('cke_wysiwyg_frame cke_reset')[0]; ifr.setAttribute('id', id+'_ifr'); ifr.id = id+'_ifr';
this sets the ID of the CKEditor iframe, because otherwise there's no easy way to access it. -Harry -Harry
|
|
Rank: Member
Groups: Registered
Joined: 2/12/2014 Posts: 20
|
I got it to work. Basically the built in spell check as you type for CK Editor was firing and causing it to fail when I was trying to get RapidSpell to work.
|
|
Rank: Member
Groups: Registered
Joined: 2/12/2014 Posts: 20
|
Hi Harry,
Thanks for that detailed info. I think I can use it. That tip about getting the id on the iframe helped a lot. But I was able to find the id of the span that the CKEditor creates and use it. And it works too.
|
|
Rank: Member
Groups: Registered
Joined: 2/12/2014 Posts: 20
|
Hi Harry, Thanks for your great solution. However, I am finding that in spite of setting Code:rapidSpell.ayt_staticMode = false; the CKEditor goes into read only mode when the spelling errors are underlined. Only when I double click it it goes back to an editable mode. Is this expected behaviour? Or is there something else we need to do.
|
|
Rank: Member
Groups: Registered
Joined: 4/22/2006 Posts: 216
|
Yes, sorry only static (or dialog) mode is supported with rich editors. -Harry -Harry
|
|