Opened 17 years ago
Closed 17 years ago
#2687 closed New Feature (invalid)
Customize contextmenu using plugin
| Reported by: | mardiros | Owned by: | |
|---|---|---|---|
| Priority: | Low | Milestone: | |
| Component: | General | Version: | |
| Keywords: | HasPatch Pending | Cc: |
Description
Plugins system is very cool,
but actually you cannot write one which is available with a right click.
And in fact, it's possible with a 50 line patch ( inspired by the FCKCommands style ). See the file joined
And now you can customize the FCKConfig.ContextMenu with whatever you want written in a plugin.
For example, a plugin with predifine value for a textfield can be create and accessible via toolbar and context menu.
FCKCommands.RegisterCommand( 'DynTextField', new FCKDialogCommand( 'DynTextField', FCKLang.DynTextFieldDlgTitle, FCKPlugins.Items['DynTextField'].Path + 'fck_DynTextField.cfm', 350, 300 ) ) ;
var oDynTextFieldItem = new FCKToolbarButton( 'DynTextField', FCKLang.DynTextFieldBtn ) ;
oDynTextFieldItem.IconPath = FCKPlugins.Items['DynTextField'].Path + 'DynTextField2.gif' ;
FCKToolbarItems.RegisterItem( 'DynTextField', oDynTextFieldItem ) ;
FCK.ContextMenu.RegisterCommand('DynTextField', {
AddItems : function( menu, tag, tagName )
{
if ( tagName == 'INPUT' && ( tag.type == 'text' || tag.type == 'password' ) )
{
menu.AddSeparator() ;
menu.AddItem( 'DynTextField', FCKLang.TextFieldProp, 51 ) ;
}
}}) ;
Attachments (1)
Change History (4)
Changed 17 years ago by
| Attachment: | plugin_contextmenu.patch added |
|---|
comment:1 Changed 17 years ago by
| Keywords: | Pending added |
|---|
comment:2 Changed 17 years ago by
| Priority: | Normal → Low |
|---|
Oh!
I haven't seen it like that...
I will do like this too.
Remark ( not really important for myself )
- You do not ordered item in context menu.
- You do not choose in your config if you want your pluggin in the context or not.
Thanks for answering alfonsoml.
comment:3 Changed 17 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |

I don't understand the problem. It's easy to add any command to the context menu without changing the core files.
Look for example at http://martinezdelizarrondo.com/imagemaps/