简体   繁体   English

在TinyMCE 4中手动调用拼写检查器

[英]Manually call Spellchecker in TinyMCE 4

I am trying to upgrade to TinyMCE 4 and am having issues with manually starting the spellchecker. 我正在尝试升级到TinyMCE 4,并且在手动启动拼写检查器时遇到问题。 It seems that this doesn't work any more: 看来这不再起作用了:

tinyMCE.execCommand('mceSpellCheck',false,'');

Any suggestions? 有什么建议么?

Also, in reviewing the JS code, it appears that "mceSpellCheck" was removed from the spellcheck js file. 另外,在检查JS代码时,似乎已从spellcheck js文件中删除了“ mceSpellCheck”。 So, how do you call those methods directly anymore in TinyMCE 4? 那么,您如何在TinyMCE 4中直接调用这些方法呢?

In the latest TinyMCE 4.2.6 that should work: 在最新的TinyMCE 4.2.6中应该可以工作:

tinymce.init({
    //... code and setup here
    setup: function(editor) {
        editor.on('init',function(e) {
            editor.execCommand('mceSpellCheck');
        });
    },
    //... and more here perhaps
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM