Context"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(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

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. 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 ) ;
                }
        }}
);
This page was last edited on 17 January 2008, at 15:23.