Search code examples
tinymce

Tinymce auto spellcheck, without clicking button


Is it possible to set turn the default spell checker on by default. Without clicking the button in the toolbar each time?

I am using the default browser spell checker functionality in the browser.

setup: function (ed) {
    ed.addCommand('mceSpellCheckRuntime', function() {
        t = ed.plugins.spellchecker;
        if (t.mceSpellCheckRuntimeTimer) {
          window.clearTimeout(t.mceSpellCheckRuntimeTimer);
        }
        t.mceSpellCheckRuntimeTimer = window.setTimeout(function() {
          t._done();
          t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {
            if (r.length > 0) {
              t.active = 1;
              t._markWords(r);
              ed.nodeChanged();
            }
         });
       }, 3000); //3 seconds
    });


    ed.onInit.add(function(ed){
        ed.pasteAsPlainText = true;

        ed.execCommand('mceSpellCheckRuntime');
    });


    ed.onKeyUp.add(function(ed, e) {
        ed.execCommand('mceSpellCheckRuntime');
    });
},

Solution

  • Nope, this is not possible due to the fact that there are so many possibilities of using a spellchecker in tinymce. The user may however define on which events the spellchecker should check (that's what you already did).