(New page: == Example on how to associate a context menu (right click menu) option == This example shows how to attach a context menu item for the "placeholder" plugin, as found in FCKEditor 2.3. Th...) |
(No difference)
|
Latest revision as of 15:23, 17 January 2008
This example shows how to attach a context menu item for the "placeholder" plugin, as found in FCKEditor 2.3. This code will be very similar for your own plugins, just add to the your fckplugin.js file.
FCK.ContextMenu.RegisterListener( { AddItems : function( menu, tag, tagName ) { // under what circumstances do we display this option if ( tagName == 'SPAN' && tag._fckplaceholder ) { // when the option is displayed, show a separator the command menu.AddSeparator() ; // the command needs the registered command name, the title for the context menu, and the icon path menu.AddItem( 'placeholder', FCKLang.PlaceholderDlgTitle, oPlaceholderItem.IconPath ) ; } }} );