Ticket #958 (closed New Feature: fixed)

Opened 10 months ago

Last modified 3 months ago

Context menu - supporting parameters

Reported by: Batalf Assigned to: alfonsoml
Priority: Normal Milestone: FCKeditor 2.6
Component: UI : Context Menu Version:
Keywords: Review+ Cc:

Description (Last modified by alfonsoml)

I have searched for this feature, but haven't found it.

What we need is the support for passing parameters from context menu item. We have implemented a list of paragraph styles in the context menu

Style
 |--- Style 1
      Style 2
      Style 3
      etc.

"Style 1", "Style 2" and "Style 3" will all call a function named "SetParagraphStyle". This function will assign the current <p> paragraph to a css class name. This class name is the param we need to send to this function.

I can't see that the AddItem method supports parameters.

Is this something that could be implemented? Or are there any workarounds?

Attachments

958.patch (3.7 kB) - added by alfonsoml on 02/23/08 23:35:14.
Proposed SVN patch

Change History

07/12/07 16:12:43 changed by alfonsoml

  • keywords deleted.
  • priority changed from High to Normal.

You can create several commands (just one constructor and use several instances) and then set in each instance the parameter that you want when you are adding them to the context menu items.

02/23/08 22:36:39 changed by alfonsoml

  • owner set to alfonsoml.
  • description changed.

02/23/08 23:35:14 changed by alfonsoml

  • attachment 958.patch added.

Proposed SVN patch

02/23/08 23:39:44 changed by alfonsoml

  • keywords set to Review?.

When I coded the integration of the spellchecker for WriteArea I did in fact create a repeated number of commands, but it would have been easier and better fix it in the core, so here's the patch.

It does allow to add a parameter that will be sent to the Execute method of the related command, quite easy but powerful.

What's new entry:

The AddItem method now has an additional fifth parameter "tag" that will be send to the Execute method of the command for that menu item, allowing a single command to be used for different menu items.

02/24/08 16:48:58 changed by fredck

  • keywords changed from Review? to Review+.

Can we change the parameter name to "customData". It's more generic, and "tag" sounds much like an MS thing ;)

Please include the above changelog on commit.

02/24/08 16:49:04 changed by fredck

  • milestone set to FCKeditor 2.6.

02/24/08 16:53:13 changed by alfonsoml

  • status changed from new to closed.
  • resolution set to fixed.

Fixed with [1602]