我可以阻止创建 CK Editor 实例吗?
我正在为使用 CK 编辑器的 CMS 开发一个 Markdown 插件。我需要禁用 CK 编辑器,这样它就不会干扰降价。
有没有办法通过 Javascript 来阻止创建 CK 编辑器实例?
该实例是使用 CK Editor for jQuery 适配器创建的,代码如下:
jQuery('#summary').ckeditor(
{
toolbar:'Summary',
customConfig : 'config.js.cfm'
},
htmlEditorOnComplete
);
我明白我可以通过侦听 instanceReady
事件来销毁实例,如下所示:
CKEDITOR.on('instanceReady', function(e){
e.editor.destroy();
});
这不适合我的需求,因为我需要定位特定的 CK Editor 实例(该区域中可以存在多个实例,但我不想要禁用它们全部)并且因为我想在 CK Editor 加载之前停止它。
I'm working on a markdown plugin for a CMS that uses CK Editor. I need to disable CK Editor so that it doesn't interfere with the markdown.
Is there a way, through Javascript, to prevent a CK Editor instance from being created?
The instance is being created with the CK Editor for jQuery adapter, the code is as follows:
jQuery('#summary').ckeditor(
{
toolbar:'Summary',
customConfig : 'config.js.cfm'
},
htmlEditorOnComplete
);
I understand that I can destroy an instance by listening for the instanceReady
event like this:
CKEDITOR.on('instanceReady', function(e){
e.editor.destroy();
});
That's not suitable for my needs because I need to target specific CK Editor instances(there are multiple that can exist in this area and I don't want to disable them all) and because I would like to stop CK Editor before it loads.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
未经测试,但您可以尝试:
这是基于您为 jQuery 适配器提供的链接的事件处理部分中的信息。
Untested, but you can try:
This is based on the info in the events handling section of the link you provided for the jQuery adaptor.
您可以使用 on instanceReady 来销毁特定元素
You can use the on instanceReady to destroy specific elements