我可以控制 CKEditor 在哪里找到要加载的插件吗?
我正在编写一个特定于我的 Web 应用程序的 CKEditor 插件。到目前为止,我已经成功地将自己的文件保留在 CKEditor 代码结构之外,但我能找到的关于插件创建过程的唯一文档(是 用户制作的教程,同样)说只需将我的插件代码硬塞到ckeditor/_source/plugins
中。
这真的是唯一的出路吗?我是否坚持将我的代码与 CKEditor 发布代码混合在一起,或者有没有办法告诉它从哪里加载插件? PLUGINPATH 设置,如果你愿意的话?
I'm writing a CKEditor plugin specific to my Web app. Until now, I've successfully kept my own files outside of the CKEditor code structure, but the only documentation I can find about the plugin creation process (being a user-made tutorial, no less) says to just shoehorn my plugin code into ckeditor/_source/plugins
.
Is this really the only way to go? Am I stuck with commingling my code with CKEditor release code, or is there a way to tell it where to load plugins from? A PLUGINPATH setting, if you will?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看您发布的教程,我发现名为“插件配置”的部分使用
CKEDITOR.plugins.add
来加载插件资源。您是否尝试过使用CKEDITOR.plugins.addExternal
代替? 可以在此处找到它的 API 文档。Looking at the tutorial you posted, I see that the section called Plugin Configuration uses
CKEDITOR.plugins.add
to load the plugin resources. Have you tried usingCKEDITOR.plugins.addExternal
instead? The API documentation for it can be found here.您想要加载未压缩、解压的插件来加载以进行调试,对吧?
就这样做吧。请参考
ckeditor_source.js
而不是。这样您在 ckeditor/_source/plugin 中创建的插件就会运行。ckeditor.js
使用显微镜阅读CKEditor 的最小设置 :)
这里有一条这样的线
对于一个出色的编辑器来说,文档太少了!
更新:
在您提供的精彩教程链接中,乔治·吴也在第一段中提到了这一点。
顺便说一句,我发现
教程为CKEDITOR创建外部插件
也很有帮助。You want to load the uncompressed, unpacked plugins to load for debugging purposes right?
Just do this. Refer
ckeditor_source.js
instead of. That way your created plugin inside theckeditor.js
ckeditor/_source/plugin
s will run.Read Minimum Setup for CKEditor with a microscope :)
There is a line like this here
Too little documentation for a wonderful editor!
Update:
And inside the wonderful tutorial link you have provided, George Wu has mentioned that in the first paragraph also.
BTW, I found
Tutorial create external plugin for CKEDITOR
helpful too.