When I right-click in the textarea, I get the options Cut, Copy and Paste.
Now I want to add the options PasteText and PasteWord to the contextmenu. I found the file fck_contextmenu.js in \editor\_source\internals\ and added these lines on line 60:
But nothing happens (also after clearing the cache). So I guess I'm messing with the wrong file? Does anybody know how to create extra options to the contextmenu?
Now I want to add the options PasteText and PasteWord to the contextmenu. I found the file fck_contextmenu.js in \editor\_source\internals\ and added these lines on line 60:
menu.AddItem( 'PasteText' , FCKLang.PasteText, 10, FCKCommands.GetCommand( 'PasteText' ).GetState() == FCK_TRISTATE_DISABLED ) ; menu.AddItem( 'PasteWord' , FCKLang.PasteWord, 11, FCKCommands.GetCommand( 'PasteWord' ).GetState() == FCK_TRISTATE_DISABLED ) ;
But nothing happens (also after clearing the cache). So I guess I'm messing with the wrong file? Does anybody know how to create extra options to the contextmenu?
Re: adding item to contextmenu
I solved my own problem!
I spend many time searching in the wrong file.
The following files need to be changed:
\editor\js\fckeditorcode_gecko.js (line 105)
\editor\js\fckeditorcode_ie.js (line 106)
Search for the function "function(menu,tag,tagName)" and replace this piece of code:
Re: adding item to contextmenu
Look in the API documentation on programming plug-ins. I did my first bit of customization by patching directly into the source code, but unless you truly need to alter core behavior, it's not a good idea. Better to add items to the context menu via a plug-in, then add the plug-in to your config file.
Re: adding item to contextmenu
But PasteText and PasteWord are standard commands of FCK.