Opened 15 years ago

Closed 15 years ago

#2445 closed New Feature (fixed)

V3: Private variable and functions in the code

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


Whenever possible, the CKEditor prototype code defines private stuff inside closures, so the CKEDITOR object and the window scope remain clean.

In some cases, specially on classes, there are private things that we to be defined "per instance". There is no way to define those privates on closures, so those kinds of things must be defined as properties in the objects itself.

To have a clean code, making also the DOM inspection clearer, a standard has been used in the prototype. All private things are defined under a single property called "_" (underscore).

To have an overview of the effect we have with it, just open any of the samples and select the DOM tab in FireBug. Then, navigate through the CKEDITOR object tree. You will find things like CKEDITOR._ and CKEDITOR.plugins._.

Change History (3)

comment:1 Changed 15 years ago by Frederico Caldeira Knabben

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

comment:2 Changed 15 years ago by Martin Kou

Keywords: Review+ added; Review? removed

comment:3 Changed 15 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