2

i am using jspell in my legacy project for spelling checks. I am not sure which version/module it is.Earlier it was used for simple text area where user could write only plain text. Now i am using tinyMCE editor(attached with text area) . Now that spell check functionality breaks. I was able to make it work with below change

function getSpellCheckArray() {
// some processing
fieldsToCheck[fieldsToCheck.length]='document.forms["form"].myTextArea';// lin 1
// some processing
}

Tweak i did is add below line above line1

document.forms["form"].myTextArea.value=tinyMCE.activeEditor.getContent();

It works fine. But problem is i see some html tags appended in window that displays spelling suggestions(these are the html tags attached by tinymce behind the scenes).

Now my question is is there a way i can integrate the tinymce with jspell? I can see one JSpell Evolution module specifically designed for tinyMCE like editors but thats paid :(. Another solution is at http://www.tinymce.com/wiki.php/Plugin:spellchecker but uses jazzy spell checker at back end. I am looking for how can i integrate tinymce with jspell?

Thariama
  • 50,002
  • 13
  • 138
  • 166
emilly
  • 10,060
  • 33
  • 97
  • 172

1 Answers1

1

Have a look here: http://atiqurrahman.wordpress.com/2009/12/29/jspell-and-tinymce/

Intregrating JSpell with TinyMCE is very easy as per JSpell wiki.

function postTinyMCEInit() {
  setTimeout(jspellInit,500);
};

tinyMCE.init({
  oninit : "postTinyMCEInit"
});

But its the default behavior. I wanted some customization like wanted to use the same button TinyMCE use for spell checking. And want to check spelling only on demand.

Here is the solution:

<script SRC="/jspellEvolution/jspellSettings.js"  CHARSET="ISO-8859-1"></script>
<script TYPE="text/javascript" SRC="/jspellEvolution/jspellEvolution.js" CHARSET="ISO-8859-1"></script>

tinyMCE.init({
    setup : function(ed) {
        ed.addButton('customSpellingButton', {
           title : 'Spelling',
           'class' : 'mceAction mce_spellchecker',
           onclick : function() {
           jspellOnDemandCheck();
           jspellDialog();
           }
        });
    },
    theme_advanced_buttons1 : "customSpellingButton",
    oninit : "postTinyMCEInit"
});

function postTinyMCEInit() {
    jspellRealtime = false;
    jspellDialogShowNoErrors = false;
    jspellShowSpellingMenu = false;
    setTimeout(jspellInit, 500);
};

function getSpellCheckArray() {
    var fieldsToCheck = new Array();
    fieldsToCheck[fieldsToCheck.length]=[document,"frm.profile_ifr"];
    return fieldsToCheck;
}

<#assign action = "myForm"?url('UTF-8')>
<form name="myForm" method="post" action="${lnk(action)} onsubmit="jspellDetach();">
Thariama
  • 50,002
  • 13
  • 138
  • 166