Hi
I have added my own custom image insertion button via a home-written plugin.
How do i make the right-click context menu point on that plugin, instead of pointing on the default image dialog?
The context item at hand is the ImageProperties
Kind regards, and thank you for a wonderful editor
Sat, 12/17/2005 - 14:42
#1
RE: Image Properties in context menu
I'd like to know it too. I tried to overwrite the internal Context Menu function, but that didn't work. I'm a newbie on FCK, but I'm working on it to find out how to customize the Context Menus. If you get any progress, let me know!
RE: Image Properties in context menu
/**
* Add an additional Context Menu for the "Variable" plugin
* Overwrite the internal function that returns the Context Menu items
*/
FCKContextMenu.__GetGroup = FCKContextMenu._GetGroup;
FCKContextMenu._GetGroup = function( groupName )
{
var oGroup ;
switch ( groupName )
{
case 'Variable' :
oGroup = new FCKContextMenuGroup() ;
oGroup.Add( new FCKContextMenuItem( this, 'Variable', FCKLang.VariableProp, true ) );
/**
* Overwrite the internal function that tells the visibility of items
* in a Context Menu
*/
oGroup.__RefreshState = oGroup.RefreshState;
oGroup.RefreshState = function()
{
// Get the actual selected tag (if any).
var oTag = FCKSelection.GetSelectedElement() ;
var sTagName ;
if ( oTag )
sTagName = oTag.tagName ;
// Set items visibility.
this.SetVisible( sTagName == 'INPUT' && ( oTag.type == 'text' ) ) ;
/**
* Calls the original function
*/
this.__RefreshState();
}
break ;
default:
/**
* Calls the original function
*/
oGroup = this.__GetGroup(groupName);
}
return oGroup;
}