One of the ideas I love about the new CKEditor is that everything is a plugin, and as such most of these plugins should be either optional, or completely changeable.
For a site I'm doing, I would like to completely replace the image plugin to choose from a gallery of images a user has already uploaded. This, however, is impossible because the ckeditor.js and ekeditor_basic.js seem to have all the plugins embeded in this one source file. I imagine it's to decrease load time and make the editor load quicker (cutting down on HTTP requests).
One would have thought that the plugins folder would have been loaded in CKEditors root directory, and it seems to for completely custom plugins. However, it's impossible to replace a stock plugin.
Also you would think that loading ckeditor_source.js would load the plugins folder in the _source directory. But instead, it loads the plugins folder in the root directory. If I'm running from source, it should be loading completely from source, shouldn't it?
Right now the only way I can load my own image plugin is by running ckeditor_source.js.
Is there a way to package it myself?
Also what plugins are optional? I tried disabling the image plugin and contextmenu plugin but these two seem "required". Is there a list of plugins that I can get rid of for a basic editor?
EDIT:
I found a reference to "CKPacker" and it seems it combines all the plugins into ckfinder.js, and in ckfinder_basic.js it does not. One would think that they would then be loaded from the plugins folder, but ckfinder_basic.js simply loads ckfinder.js immediately (it seems).
Thanks,
Luke
Fri, 09/04/2009 - 22:44
#1
Re: Plugin development VERY confusing
You can use a custom image browser with the standard image button without having to build a plugin. It doesn't appear to be working properly at the moment: viewtopic.php?f=11&t=15618
but if you set the configuration to recognize your pages like so:
The file you'll need to modify is called config.js and is located in the root folder of the Javascript. There's more info in the help files: http://docs.fckeditor.net/CKEditor_3.x/ ... _(Uploader)
Re: Plugin development VERY confusing
This obvious question has been asked on this forum about 500 times with no answer yet.
Re: Plugin development VERY confusing
G'day, I would like to second this.
I think the new editor is great, and am looking forward to creating some plugins to get it wo work with our software.
The simplist is just what stylo~ asked, how to add a simple button?
Really, what I want is to be able to access the JSON definition of plugin dialogs, and modify them without having to modify the ckeditor source code.
viewtopic.php?f=11&t=15586&hilit=dialog+definition and
viewtopic.php?f=11&t=15622&hilit=+dialog+link+page
Are pretty much what we are after, but the first post has no answer, and the second involves modifying the source.
So yeah, any pointers on how to modify/access dialog definitions for plugins which have been registered would be grouse.
Re: Plugin development VERY confusing
I have used the config options removePlugins and extraPlugins. Obviously this means that your new plugin needs to be renamed slightly different from the one it is overwritting but that makes sense if anyone else has to come along and tweak you code as they will know it is nolonger core. (also means it wont be overwritten when you upgrade ckeditor)
e.g.
removePlugins:'save,resize',
extraPlugins:'saveCMS,cmslocation,cmstemplate,autogrow',
you can also pass bespoke config options thr the config area
e.g.
filebrowser_cmsbrowse : '/cgi-bin/go.pl/admin/cms-browse-ckeditor.html',
filebrowser_image_browse_url : '/ckfinder/ckfinder4cms.html?action=js&func=SetUrl&thumbFunc=SetUrl&Type=Images',
filebrowser_file_browse_url : '/ckfinder/ckfinder4cms.html?action=js&func=SetUrl&thumbFunc=SetUrl&Type=Files',
which means you can change these for each instance and then just have your plugin read the path/value that you need to alter from the config file.
Re: Plugin development VERY confusing
(First I apologize for the late reply. I don't frequent these forums very often, and my work schedule takes up a lot of my time)
I'm not looking to create a file manager built upon the existing image plugin, I'm looking to replace it. And it seems that it is near impossible to do so because despite my best efforts I have not been able to remove the plugin or it's right click menu.
What I want to do is simply display a grid of already uploaded images. Is this possible?
Re: Plugin development VERY confusing
If you look at the _source\plugins\image directory you will see all the plugins with full comments and so on. This code is not actually used during run time because it has been compressed into the main js file like you observed. However, it is a great reference and you can modify this code to make a new plug in. However, you will need to copy the image plugin to the root ckeditor plugins folder and CALL IT SOMETHING ELSE, like myimage. Then you need to remove the original image plugin and add your new one:
removePlugins:'image',
extraPlugins:'myimage',
I have been working on some plugin documentation for while, which you can find at http://syrinx.ph/articles/CkEditorPluginGuide.aspx
Hopefully it will help you to understand the overall plugin architecture and successfully get started on your own plugin. I use it for exactly what you are trying to do in our Syrinx Community Server product.