2012-07-07 40 views
1

默認情況下是否可以設置打開默認拼寫檢查器。沒有每次點擊工具欄中的按鈕?Tinymce自動拼寫檢查,無需點擊按鈕

我在瀏覽器中使用默認的瀏覽器拼寫檢查功能。

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'); 
    }); 
}, 

回答

0

不,這是不可能的,因爲這樣的事實,有在TinyMCE的使用拼寫檢查的這麼多的可能性。然而,用戶可以定義拼寫檢查器應檢查哪些事件(這就是你已經做的)。

1

它的安靜可能........ :)

試試下面的代碼.......

ed.onInit.add(function(ed, e) { 
    setTimeout(function() { 
    tinyMCE.activeEditor.controlManager.setActive('spellchecker', true); tinymce.execCommand('mceSpellCheck', true); 
}, 1); 
});