I'm creating a plugin which allows the user to insert a slideshow into the text area using code from Slideshow2 on the google code source. Slideshow2 works great for me and I'm able to get it working by simply inserting a slideshow instance into the text area, but now I want a button to insert it without messing with the source. This will also allow the user to choose images for the slideshow using CKFinder.
I looked at the _samples directory and played around with the "api_dialog" example and was able to create a custom button with custom dialog boxes, but I am more interested in creating a genuine plugin for my application.
Looking through the forum I haven't found any solid information on creating plugins within CKeditor yet. Can someone enlighten me on a step-by-step process to create a new plugin?
So far I have decided to start by copying an existing plugin from the ckeditor/plugins directory. Specifically I copied the image plugin and started modifying it. Getting deeper into it I have come to find that there's some very specific code to add to a few different files. Can anyone help here? Which files need what? When I'm done I'll post on the exact method I used to accomplish it.
I looked at the _samples directory and played around with the "api_dialog" example and was able to create a custom button with custom dialog boxes, but I am more interested in creating a genuine plugin for my application.
Looking through the forum I haven't found any solid information on creating plugins within CKeditor yet. Can someone enlighten me on a step-by-step process to create a new plugin?
So far I have decided to start by copying an existing plugin from the ckeditor/plugins directory. Specifically I copied the image plugin and started modifying it. Getting deeper into it I have come to find that there's some very specific code to add to a few different files. Can anyone help here? Which files need what? When I'm done I'll post on the exact method I used to accomplish it.
Re: Creating Plugins in CKeditor
OK, my knowledge is limited to playing around with existing plugins and code, but I've learned a few things. I know how to create a custom button and use my own image for it. I also know the basic structure for the plugins and what other code files they interact with.
As for the folder structure, you have to add a folder to the ckeditor/plugins folder and you'll name it the name of your plugin. Under this will be a file called "plugin.js" and a folder called "dialogs". The dialogs folder has a file in it with the same name as your plugin, like this: "slideshow.js". The dialogs file will further define your menu structure for when you click the button on the ckeditor instance. You can just take a look at the plugins directory for LOTS of examples since every single ckeditor button is in here. Although you should look at the ckeditor\_source\plugins folder instead since this code has not been optimized for fast downloads (it's way easier to read).
To start creating your files, you must alter the en.js file under the ckeditor/lang folder (or corresponding file for whatever language you're using). Alternatively you can just create your own en.js file here: ckeditor/plugins/slideshow/lang/en.js. Then you show the ckeditor/plugins/slideshow/plugin.js file where this new en.js file resides by adding the following: