I wrote a plugin to add a new combobox into toolbar. But somehow it doesn't work. It seems to be as unknown toolbar item. I added the code below. I need this soon. the error is: FCKToolbarSet.DOMElement is null or not an object. I am waiting for suggestions. I did all other settings for my combobox to be seen in toolbar according to documentary about plugins.
Thank youu!!!
//fckplugin.js
var FCKToolbarParagraphStyleCombo = function (tooltip, style)
{
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarParagraphStyleCombo.prototype = new FCKToolbarSpecialCombo ;
FCKToolbarParagraphStyleCombo.prototype.GetLabel = function()
{
return FCKLang.ParagraphStyle ;
}
FCKToolbarParagraphStyleCombo.prototype.CreateItems = function( targetSpecialCombo )
{
}
var ParagraphStyleCommand = function()
{
this.Name = 'ParagraphStyle';
}
ParagraphStyleCommand.prototype.Execute = function(paragraphstyle)
{
if (paragrapstyle == null || paragraphstyle == "")
{
//
}
else
FCK.ExecuteNamedCommand('ParagraphStyle', paragraphstyle);
}
ParagraphStyleCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandValue( 'ParagraphStyle' );
}
FCKCommands.RegisterCommand('ParagraphStyle', ParagraphStyleCommand);
var oParagraghStyle = new FCKToolbar('ParagraphStyle', new FCKToolbarParagraphStyleCombo( null, FCK_TOOLBARITEM_ICONTEXT ));
FCKToolbarItems.RegisterItem('ParagraphStyle', oParagraghStyle);
Thank youu!!!
//fckplugin.js
var FCKToolbarParagraphStyleCombo = function (tooltip, style)
{
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarParagraphStyleCombo.prototype = new FCKToolbarSpecialCombo ;
FCKToolbarParagraphStyleCombo.prototype.GetLabel = function()
{
return FCKLang.ParagraphStyle ;
}
FCKToolbarParagraphStyleCombo.prototype.CreateItems = function( targetSpecialCombo )
{
}
var ParagraphStyleCommand = function()
{
this.Name = 'ParagraphStyle';
}
ParagraphStyleCommand.prototype.Execute = function(paragraphstyle)
{
if (paragrapstyle == null || paragraphstyle == "")
{
//
}
else
FCK.ExecuteNamedCommand('ParagraphStyle', paragraphstyle);
}
ParagraphStyleCommand.prototype.GetState = function()
{
return FCK.GetNamedCommandValue( 'ParagraphStyle' );
}
FCKCommands.RegisterCommand('ParagraphStyle', ParagraphStyleCommand);
var oParagraghStyle = new FCKToolbar('ParagraphStyle', new FCKToolbarParagraphStyleCombo( null, FCK_TOOLBARITEM_ICONTEXT ));
FCKToolbarItems.RegisterItem('ParagraphStyle', oParagraghStyle);