拼写检查器在 tinymce 4.0 中不起作用(非 JSON 响应) [英] Spellchecker is not working in tinymce 4.0 (Non JSON response)

查看:32
本文介绍了拼写检查器在 tinymce 4.0 中不起作用(非 JSON 响应)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 TinyMCE 4.0 中使用 Spellchecker,但它返回错误:

I'm trying to use Spellchecker in TinyMCE 4.0, but it returns the error:

Non JSON response:<br />
<b>Warning</b>:  call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'PSpellShell::spellcheck' was given in <b>/home/www/misitio.com/doc/plugins/tinymce/plugins/spellchecker/rpc.php</b> on line <b>98</b><br />
{"id":null,"result":null,"error":null}

我使用的代码是:

//Javascript:
tinymce.init({
        selector: "textarea",
        theme: "modern",
        language : 'es',
        menubar : false,
        height: 400,
        autoresize_min_height: 400,
        plugins: [
            "advlist autolink lists link image charmap hr",
            "searchreplace wordcount visualchars fullscreen",
            "insertdatetime table contextmenu directionality",
            "template textcolor autoresize spellchecker"
        ],
        toolbar: "undo redo | styleselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor | subscript superscript | removeformat blockquote | charmap inserttime | link image | table hr | searchreplace | fullscreen spellchecker",
        image_advtab: true,
        spellchecker_languages : "+English=en",
        spellchecker_rpc_url: 'plugins/tinymce/plugins/spellchecker/rpc.php'
    });

带插件 PHP Spellchecker 2.0.6.1 (http://www.tinymce.com/develop/changelog/?type=phpspell)

with plugin PHP Spellchecker 2.0.6.1 (http://www.tinymce.com/develop/changelog/?type=phpspell)

我认为您可以解决 Google 尝试https://github.com/tinymce/tinymce_spellchecker_php<的连接问题/a> 只是不知道如何集成它,有没有人能够在 TinyMCE 4.0 中使用拼写检查器?或者他们是否知道将 Spellchecker 集成到 TinyMCE 4.0 的任何教程?

I think that you can fix connection problems with Google trying to https://github.com/tinymce/tinymce_spellchecker_php just do not see how to integrate it, Has anyone been able to use the Spellchecker in TinyMCE 4.0? or do they know of any tutorial to integrate Spellchecker to TinyMCE 4.0?

好的,谢谢!:D

推荐答案

这个问题可以通过更新php拼写检查插件中的几行来解决.

This issue can be resolved by updating few lines in php spell checker plugin.

1) 将 EnchantSpell、GoogleSpell、PSpell、PSpellShell 和 SpellChecker 类的&checkWords"方法重命名为&spellcheck"

1) Rename "&checkWords" method to "&spellcheck" of EnchantSpell, GoogleSpell, PSpell, PSpellShell and Sp ellChecker classes

2) 更新拼写检查方法以按以下格式返回数据

2) update spellcheck method to return the data in following format

array(
    'incorrect word 1'=>array('suggestion 1','suggestion 2', etc...),
    'incorrect word 2'=>array('suggestion 1','suggestion 2', etc...),
)

例如让我们更新 EnchantSpell.php 文件的拼写检查方法

For example lets update spellcheck method of EnchantSpell.php file

......

if(!$correct) {
    //$returnData[] = trim($value);
    $returnData[trim($value)] = $this->getSuggestions($lang, trim($value));
}

......

这篇关于拼写检查器在 tinymce 4.0 中不起作用(非 JSON 响应)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆