Opened 15 years ago

Last modified 15 years ago

#2817 closed Task

Adding necessary events for commands — at Initial Version

Reported by: Garry Yao Owned by:
Priority: Normal Milestone: CKEditor 3.0
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Pending Cc:

Description

I found some commands side behaviors might need to be central controlled to reduce code DUP:

  • CKEDITOR.dialog.saveSelection plus it's sibling CKEDITOR.dialog.restoreSelection which has big things to do with making the selection correct in IE, were Invoked >50 times through different commands.
  • "FCKUndo.SaveUndoStep" back in v2 which support the undo/redo system is also invoked arround this number in the same case.

I wonder if we can hook these aspects of commands with some new types of events , the ones I can imagine were:

  • initCommand which fired right after user click/hit the command, was used to allocate necessary resources for the command, this could be used to hook things like save the selection.
  • beforeCommandExe which indicate the command is about to make changes to the document, would be fired at different time for synchronized(e.g. styles) and asynchronized(e.g. dialogs), highly valuable for things like save undo stacks.
  • "afterCommandExe" on contrast indicate the command has made actually changes to the documents, used for restore selections and save redo stacks.
  • abortCommandExe" would be a branch case if the command has been canceled and thus has no major effect, which just bring user back to the document.

Change History (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy