I'm writing a plugin and I can get the contextual menu item to show up ok and it opens my plugin window but I can't find how to pass the selected tag over to my plugin.
I read that the ContextMenu.addItem function takes a 5th parameter for the tag but there are only 3 parameters in the addItem examples.
Also how would I read this parameter from my plugin?
I read that the ContextMenu.addItem function takes a 5th parameter for the tag but there are only 3 parameters in the addItem examples.
Also how would I read this parameter from my plugin?
Re: How do I pass the selected tag onto a contextual menu call?
After reading the function definition for addItem, it seems the version of FCKeditor I'm using only takes 3 arguments.
Here is where I read about the 5th parameter for passing tag:
http://dev.fckeditor.net/ticket/958
It looks like it might be in a 2.6 release. Is there any way to get round it with the current release?
For example, say I have a span tag with style="color:#CCCCCC" and I have a contextual menu plugin that appears on right-clicking a span tag, how do I pass the style information over to it?
I don't have access to the FCKeditor instance from the plugin so I couldn't say get the selected tag that way.
Re: How do I pass the selected tag onto a contextual menu call?
Check any plugin that uses the context menu to see how it works.
Re: How do I pass the selected tag onto a contextual menu call?
FCKCommansd.RegisterCommand('name', new FCKDialogCommand(...
I now do:
var FCKmydialog = function(name)
{
this.Name = name;
}
FCKmydialog.prototype.Execute = function(){
...
selection = FCK.Selection.GetSelectedElement();
new_window = window.open('path_to_plugin',width, height etc);
}
FCKCommand.RegisterCommand('name', new FCKmydialog('popup'));
I should be able to pass the selected tag info through a PHP get request (although I might reach a length limit in IE) but I'm not sure how I would pass a result back from the popup to the FCKmydialog execute function so I can replace the selected element.
Re: How do I pass the selected tag onto a contextual menu call?
As I said, look at other plugins or the built-in dialogs, don't make it harder than it is.
Re: How do I pass the selected tag onto a contextual menu call?
I didn't realise I could access the FCK editor instance from the plugin popup.