Hi,
I am trying to create a tool bar button and the steps i did while doing these are as follows ...
1) updated the fckconfig.js like below ...
FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'],
'/',
['button']
] ;
FCKConfig.Plugins.Add( 'btn' ) ;
2) created a folder called "btn" under plugins directory ...
3) created fckplugin.js under the "btn" folder and the code in the .js file is as follows ...
/* code-start */
var FCKMybtn_command = function(name) {
this.Name = name ;
}
FCKMybtn_command.prototype.Execute = function() {
FCK.InsertHtml('## Custom Button Clicked ##');
}
FCKMybtn_command.prototype.GetState = function() {
return;
}
FCKCommands.RegisterCommand( 'mycommand' , new FCKMybtn_command('any_name') ) ;
var oButton = new FCKToolbarButton('mycommand',FCKCommands.GetCommand('mycommand'));
oButton.IconPath = FCKConfig.plugins+'btn/new/gif';
FCKToolbarItems.RegisterItem('button',oButton);
/* end-code */
When I run the sample01.html the following error is comming ... "Unknown toolbar Item 'butoon' ".
Here I created my own command instead of that does it have any toolbar-command like a dialog-command ?
When I want to create a simple button with a label appearing on it instead of Icon button wht shud i do?
In my fckplugin.js file how can i put html-code to create a html-button ?
Pls help me in this
Thanks in Advance.
I am trying to create a tool bar button and the steps i did while doing these are as follows ...
1) updated the fckconfig.js like below ...
FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'],
'/',
['button']
] ;
FCKConfig.Plugins.Add( 'btn' ) ;
2) created a folder called "btn" under plugins directory ...
3) created fckplugin.js under the "btn" folder and the code in the .js file is as follows ...
/* code-start */
var FCKMybtn_command = function(name) {
this.Name = name ;
}
FCKMybtn_command.prototype.Execute = function() {
FCK.InsertHtml('## Custom Button Clicked ##');
}
FCKMybtn_command.prototype.GetState = function() {
return;
}
FCKCommands.RegisterCommand( 'mycommand' , new FCKMybtn_command('any_name') ) ;
var oButton = new FCKToolbarButton('mycommand',FCKCommands.GetCommand('mycommand'));
oButton.IconPath = FCKConfig.plugins+'btn/new/gif';
FCKToolbarItems.RegisterItem('button',oButton);
/* end-code */
When I run the sample01.html the following error is comming ... "Unknown toolbar Item 'butoon' ".
Here I created my own command instead of that does it have any toolbar-command like a dialog-command ?
When I want to create a simple button with a label appearing on it instead of Icon button wht shud i do?
In my fckplugin.js file how can i put html-code to create a html-button ?
Pls help me in this
Thanks in Advance.
Re: Urgent: Unable to create a custom button in the toolbar sect
Have a look at this thread for some help.
viewtopic.php?f=6&t=10186
Re: Urgent: Unable to create a custom button in the toolbar sect