Opened 16 years ago

Closed 16 years ago

#2446 closed New Feature (fixed)

V3: Event System

Reported by: Frederico Caldeira Knabben Owned by: Frederico Caldeira Knabben
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: Confirmed V3ProtoBase Review+ Cc:

Description

The new event system must be coded, as defined in the Event Driven page in the ODE docs.

Change History (6)

comment:1 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review? added
Owner: set to Frederico Caldeira Knabben
Status: newassigned

The implementation of it can be found at the event.js file (CKEDITOR.event) in the CKEDITOR prototype.

Performance is quite important here.

comment:2 Changed 16 years ago by Martin Kou

Keywords: Review+ added; Review? removed

The most critical piece of code here is CKEDITOR.event::fire(), as it is expected that it will be called a lot. I used the following code snippet to test its performance:

a = new CKEDITOR.event();
for(var i=0;i<100000;i++)
    a.fire('nosuchevent', '');

The previous prototype code created two closures called stopEvent and cancelEvent for each time fire() is called... which doesn't seem very efficient. I've moved the creation of the two closures out in [2349] to improve performance. I've got a nearly 3x improvement in performance with the new code according to Firebug's profiler with the above code snippet.

comment:3 Changed 16 years ago by Frederico Caldeira Knabben

The changes on [2349] have broken the event system because you may have nested fire() calls. For example, event A could call a function that fires event B. If event B got canceled, event A was being canceled as well.

I've made a small improvement over those changes with [2350], still avoiding creating the functions for each call, but fixing the above issue.

comment:4 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review? added; Review+ removed

comment:5 Changed 16 years ago by Martin Kou

Keywords: Review+ added; Review? removed

comment:6 Changed 16 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed
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