Ticket #958 (closed New Feature: fixed)

Opened 7 years ago

Last modified 6 years ago

Context menu - supporting parameters

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

Description (last modified by alfonsoml) (diff)

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 6 years ago.
Proposed SVN patch

Change History

comment:1 Changed 7 years ago by alfonsoml

  • Keywords context menu,parameters, menu item removed
  • 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.

comment:2 Changed 6 years ago by alfonsoml

  • Owner set to alfonsoml
  • Description modified (diff)

Changed 6 years ago by alfonsoml

Proposed SVN patch

comment:3 Changed 6 years ago by alfonsoml

  • Keywords Review? added

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.

comment:4 Changed 6 years ago by fredck

  • Keywords Review+ added; Review? removed

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.

comment:5 Changed 6 years ago by fredck

  • Milestone set to FCKeditor 2.6

comment:6 Changed 6 years ago by alfonsoml

  • Status changed from new to closed
  • Resolution set to fixed

Fixed with [1602]

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy