我一直在努力将 ASPNetSpell 的拼写检查器 ( http://www.aspnetspell.com/ ) 集成到 CKEditor ( http://ckeditor.com/ ) 中。我在 IE 8+、FireFox 12 和 Chrome 18.0.1025.152m 之间看到了一些令人不安的行为。
缺点似乎是 ASPNetSpell 在 Chrome 中找不到 CKEditor 的实例,但在 IE 和 Firefox 中却可以。
我已按照 ASPNetSpell 文档中的建议集成到“所有主要的 HTML 编辑器,包括 FCKEditor、CKEditor、TinyMCE ...”:
var spellinstance = new LiveSpellInstance();
spellinstance.Fields = "EDITORS";
spellinstance.ServerModel = "aspx";
spellinstance.DrawSpellImageButton();
我的理解是,当您将字段设置为“EDITORS”时,这会指示 ASPNetSpell 的客户端脚本查找所有 IFrame。
然而,模式对话框确实显示在 Chrome 中,我确实看到它向服务器发出请求,但是当它返回到对话框时,它的行为就像没有设置拼写检查的字段一样。当您在要检查的字段中有拼写错误时,IE 和 Firefox 会以这种方式运行。
我有以下问题:
- 有没有人在带有 HTML 编辑器的 Chrome 中使用 ASPNetSpell 的拼写检查器的经验?
- 我接下来可以看哪里?
- 为什么模态对话框不加载拼写建议?
更新
我已经向他们的支持部门发送了另一封电子邮件,其中包括指向该帖子的链接。希望 ASPNETSPELL 能够增加一些专业知识。
澄清
我知道 ASPNETSPELL 不支持编辑器使用的文本区域上的 SCAYT(键入时进行拼写检查)。我正在寻求的功能是单击按钮时完成的显式拼写检查。
更新#2
我已经下载了 ASPNetSpell Support 的回答中引用的最近的 ASPNETSPELL 包。我仍然没有运气让它在 Chrome 中工作(当前版本现在是 21.0.1180.89 m)。当仅验证没有附加 CKEditor 实例的文本区域时,它将起作用。
下面是我的 Razor 视图目前的样子。
@using ASPNetSpell
@{
Layout = "~/_SiteLayout.cshtml";
Page.Title = "Welcome to my Web Site!";
}
@{
ASPNetSpell.Razor.SpellButton mySpellButton = new ASPNetSpell.Razor.SpellButton();
mySpellButton.InstallationPath = ("/Content/ASPNetSpellInclude");
mySpellButton.FieldsToSpellCheck = "myTextArea";
}
<p>
<div id="spellcheckthis">
<textarea id="myTextArea"></textarea>
</div>
<div>
@Html.Raw(mySpellButton.getHtml())
</div>
</p>
<script type="text/javascript" src="/scripts/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/scripts/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$("#myTextArea").ckeditor();
</script>
当我注释掉这一行时,它起作用了。
$("#myTextArea").ckeditor();