this is my plugin:
var FCKToolbarStyleDropList = function( tooltip, style )
{
this.CommandName = 'DropList' ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarStyleDropList.prototype = new FCKToolbarSpecialCombo ;
FCKToolbarStyleDropList.prototype.GetLabel = function()
{
return FCKLang.Style ;
}
FCKToolbarStyleDropList.prototype.CreateItems = function( targetSpecialCombo )
{
var oTargetDoc = targetSpecialCombo._Panel.Document ;
// Add the Editor Area CSS to the panel so the style classes are previewed correctly.
FCKTools.AppendStyleSheet( oTargetDoc, FCKConfig.ToolbarComboPreviewCSS ) ;
oTargetDoc.body.className += ' ForceBaseFont' ;
// Add ID and Class to the body
if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 )
oTargetDoc.body.id = FCKConfig.BodyId ;
if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 )
oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ;
// For some reason Gecko is blocking inside the "RefreshVisibleItems" function.
// The problem is present only in old versions
if ( !( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsGecko10 ) )
targetSpecialCombo.OnBeforeClick = this.RefreshVisibleItems ;
// Add the item to the special combo.
targetSpecialCombo.AddItem("aa", "11");
targetSpecialCombo.AddItem("bb", "22");
targetSpecialCombo.AddItem("cc", "33");
targetSpecialCombo.AddItem("dd", "44");
}
.......like fcktoolbarstylecombo..........
But not item added to combo.
var FCKToolbarStyleDropList = function( tooltip, style )
{
this.CommandName = 'DropList' ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// Inherit from FCKToolbarSpecialCombo.
FCKToolbarStyleDropList.prototype = new FCKToolbarSpecialCombo ;
FCKToolbarStyleDropList.prototype.GetLabel = function()
{
return FCKLang.Style ;
}
FCKToolbarStyleDropList.prototype.CreateItems = function( targetSpecialCombo )
{
var oTargetDoc = targetSpecialCombo._Panel.Document ;
// Add the Editor Area CSS to the panel so the style classes are previewed correctly.
FCKTools.AppendStyleSheet( oTargetDoc, FCKConfig.ToolbarComboPreviewCSS ) ;
oTargetDoc.body.className += ' ForceBaseFont' ;
// Add ID and Class to the body
if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 )
oTargetDoc.body.id = FCKConfig.BodyId ;
if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 )
oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ;
// For some reason Gecko is blocking inside the "RefreshVisibleItems" function.
// The problem is present only in old versions
if ( !( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsGecko10 ) )
targetSpecialCombo.OnBeforeClick = this.RefreshVisibleItems ;
// Add the item to the special combo.
targetSpecialCombo.AddItem("aa", "11");
targetSpecialCombo.AddItem("bb", "22");
targetSpecialCombo.AddItem("cc", "33");
targetSpecialCombo.AddItem("dd", "44");
}
.......like fcktoolbarstylecombo..........
But not item added to combo.
Re: How add item to combo by plugin?
up