繁体   English   中英

Django TinyMCE拼写检查器无法在Chrome,Safari中正常运行

[英]Django TinyMCE spellchecker not working properly in Chrome, Safari

我在我的Django应用程序中为表单使用TinyMCE编辑器。 但是,拼写检查器插件无法在Chrome(版本21.0.1180.79)和Safari(版本5.1.7)中正常运行,但在Firefox中可正常使用。 这里的“无法正常工作”意味着,与tinymce的功能全面的示例http://fiddle.tinymce.com/baaaab相比,拼写检查器的行为不如应有的。 我正在使用django-tinymce v1.5.1b2,/ static / js / tiny_mce中tinymce的版本是3.5.6(基于tiny_mce_src.js)

当使用Chrome / Safari时,在单击“切换拼写检查”按钮之前键入的拼写错误的单词不会用红色下划线显示(我必须单击这些单词才能用红色下划线显示)。 禁用拼写检查功能(再次单击该按钮)后,拼写错误的单词中的红色下划线不会自动删除(再次,我必须单击这些单词,以便红色下划线消失)。

就像全功能示例一样,拼写检查功能在Firefox中效果很好。 我认为这是一个JavaScript问题,但是在通过浏览器进行调试时我没有看到错误。 任何帮助将不胜感激!

编辑:这是我的tinymce初始化代码:

tinyMCE.init({
mode : "textareas",
theme : "advanced",
width: "565", 
height: "150",
plugins : 'table,spellchecker,paste,searchreplace,autoresize',

theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,outdent,indent,|,bullist,numlist,blockquote,|,formatselect,|,undo,redo,|,spellchecker,|,pastetext,pasteword,removeformat",
theme_advanced_buttons2: "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align: "center",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: "true",
theme_advanced_resizing_min_width: "565",
theme_advanced_resizing_min_height: "150",
theme_advanced_resizing_max_width: "565",
theme_advanced_blockformats: "p,h2,h3,h4,h5,h6,blockquote",
});

我对夹层有类似的问题,这是使用django-grappelli (实现tinyMCE)的Django CMS。 我想这种解决方案也可以应用于您的案例。

我已经解决了将这两行放入tinyMCE_setup.js文件的init方法中的tinyMCE_setup.js

 tinyMCE.init({
    // ...
    gecko_spellcheck : true,
    browser_spellcheck : true,
    // ...
});

这使用浏览器内拼写检查(默认情况下停用)。 第一行将其激活以用于Chrome和Firefox,第二行使其也可用于Safari。

暂无
暂无

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

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