Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Integration with CKEditor - RapidSpell Web ASP.NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
Guest
#1 Posted : Monday, November 30, 2009 8:50:10 AM
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
Dan
#2 Posted : Monday, November 30, 2009 10:46:55 AM
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
avsln
#3 Posted : Friday, February 14, 2014 10:39:09 PM
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.
harry
#4 Posted : Friday, February 14, 2014 10:51:33 PM
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
avsln
#5 Posted : Friday, February 14, 2014 10:55:52 PM
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.
harry
#6 Posted : Saturday, February 15, 2014 3:57:56 AM
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
avsln
#7 Posted : Saturday, February 15, 2014 4:51:49 AM
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.
avsln
#8 Posted : Saturday, February 15, 2014 5:45:50 PM
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.
avsln
#9 Posted : Wednesday, February 19, 2014 11:23:39 PM
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.
harry
#10 Posted : Wednesday, February 19, 2014 11:55:30 PM
Rank: Member

Groups: Registered

Joined: 4/22/2006
Posts: 216
Yes, sorry only static (or dialog) mode is supported with rich editors.

-Harry
-Harry
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.