最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Can I control where CKEditor finds plugins to load? - Stack Overflow

programmeradmin3浏览0评论

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 mingling 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?

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 mingling 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?

Share Improve this question asked Jan 8, 2011 at 1:40 Luke MaurerLuke Maurer 8,2452 gold badges25 silver badges25 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 13

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 using CKEDITOR.plugins.addExternal instead? The API documentation for it can be found here.

You want to load the unpressed, unpacked plugins to load for debugging purposes right?

Just do this. Refer ckeditor_source.js instead of ckeditor.js. That way your created plugin inside the ckeditor/_source/plugins will run.

Read Minimum Setup for CKEditor with a microscope :) There is a line like this here

_source — this directory contains CKEditor source code. It is needed only if you intend to use the ckeditor_source.js script and load CKEditor from source files.

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.

During development, you will want to execute from source code by using ckeditor_source.js instead of ckeditor.js.

Now, create ckeditor_source\plugins\footnote folder and plugin.js under that folder.

BTW, I found Tutorial create external plugin for CKEDITOR helpful too.

发布评论

评论列表(0)

  1. 暂无评论