I have not found any way of creating my own buttons. What i am looking for is to via some configuration add my own buttons with there own javascript commands.
Is this possible? If not is it a planned feature?
Is this possible? If not is it a planned feature?
RE: Creating cutom buttons/commands
I'm trying to figure out the same thing right now for v2.0b2. We need an easy and flexible way to add ToolbarItems that call specifc external JavaScript-Functions.
There are two very useful posts in the forum, I have found so far
http://sourceforge.net/forum/message.php?msg_id=2774522 (Shows how to add an additional dialog)
http://sourceforge.net/forum/message.php?msg_id=2754799
(Windows Batch-File to combine/package the Javascript files in the _source-Directory so that your code changes there get effective).
Hope this helps you. If you want to, I can inform you if we succeed in integrating our custom javascript calls.
RE: Creating cutom buttons/commands
Yes I would be very intrested in hearing if you add some feature which makes it easy to add your own custom buttons.
Thanks for the help
Ludde
RE: Creating cutom buttons/commands
1. Defining a new button in the fcktoolbaritems.js file by adding the row
TBI.prototype.MyOwnButton = new TBButton("myOwnImage", "Tooltip", "myOwnButton()", TBCMD_CUSTOM) ;
You also need to add myOwnImage.gif to where all the directory of the skin you are using.
2. Define what happends when the button is clicked by adding to fck_actions.js:
function myOwnButton()
{
alert('my own button clicked');
}
3. Add the button to a toolbar by updating fck_config.js. In the ToolbarSets section add 'MyOwnButton'
What i have not figured out is how to do this on the V2 version. Changing the source does not help here right?? Because the js is compiled together in some way is that correct. Please help anyone...
Thanks
Ludde
RE: Creating cutom buttons/commands
1) Create the button icon and place it in the appropriate skins/____/toolbar folder. It must be named the same as the new button and must be in lower case.
2) Add Label for the button in the language page
3) Add the item in internals/fcktoolbaritems.js
4) Add the command in commandclasses/fck_othercommands.js. Make sure to name the functions correctly. There are three functions for each command. If you want to set up a new dialog, you need to set up the HTML dialog box and the handler JS for that. It's more complicated. This is just for a simple button.
5) Add the button in the fckeditor/fckconfig.js file
6) Add the command in internals/fckcommand.js
Run The Packager.
Clear Cache.
The action for the toolbar button is in the command created in fck_othercommands.js
Hope this helps.
RE: Creating cutom buttons/commands