2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
7 * @fileOverview Contains the third and last part of the {@link CKEDITOR} object
\r
11 // Remove the CKEDITOR.loadFullCore reference defined on ckeditor_basic.
\r
12 delete CKEDITOR.loadFullCore;
\r
15 * Holds references to all editor instances created. The name of the properties
\r
16 * in this object correspond to instance names, and their values contains the
\r
17 * {@link CKEDITOR.editor} object representing them.
\r
20 * alert( <b>CKEDITOR.instances</b>.editor1.name ); // "editor1"
\r
22 CKEDITOR.instances = {};
\r
25 * The document of the window holding the CKEDITOR object.
\r
26 * @type {CKEDITOR.dom.document}
\r
28 * alert( <b>CKEDITOR.document</b>.getBody().getName() ); // "body"
\r
30 CKEDITOR.document = new CKEDITOR.dom.document( document );
\r
33 * Adds an editor instance to the global {@link CKEDITOR} object. This function
\r
34 * is available for internal use mainly.
\r
35 * @param {CKEDITOR.editor} editor The editor instance to be added.
\r
38 CKEDITOR.add = function( editor )
\r
40 CKEDITOR.instances[ editor.name ] = editor;
\r
42 editor.on( 'focus', function()
\r
44 if ( CKEDITOR.currentInstance != editor )
\r
46 CKEDITOR.currentInstance = editor;
\r
47 CKEDITOR.fire( 'currentInstance' );
\r
51 editor.on( 'blur', function()
\r
53 if ( CKEDITOR.currentInstance == editor )
\r
55 CKEDITOR.currentInstance = null;
\r
56 CKEDITOR.fire( 'currentInstance' );
\r
62 * Removes and editor instance from the global {@link CKEDITOR} object. his function
\r
63 * is available for internal use mainly.
\r
64 * @param {CKEDITOR.editor} editor The editor instance to be added.
\r
67 CKEDITOR.remove = function( editor )
\r
69 delete CKEDITOR.instances[ editor.name ];
\r
73 * Perform global clean up to free as much memory as possible
\r
74 * when there are no instances left
\r
76 CKEDITOR.on( 'instanceDestroyed', function ()
\r
78 if ( CKEDITOR.tools.isEmpty( this.instances ) )
\r
79 CKEDITOR.fire( 'reset' );
\r
82 // Load the bootstrap script.
\r
83 CKEDITOR.loader.load( 'core/_bootstrap' ); // @Packager.RemoveLine
\r
85 // Tri-state constants.
\r
88 * Used to indicate the ON or ACTIVE state.
\r
92 CKEDITOR.TRISTATE_ON = 1;
\r
95 * Used to indicate the OFF or NON ACTIVE state.
\r
99 CKEDITOR.TRISTATE_OFF = 2;
\r
102 * Used to indicate DISABLED state.
\r
106 CKEDITOR.TRISTATE_DISABLED = 0;
\r
109 * Fired when the CKEDITOR.currentInstance object reference changes. This may
\r
110 * happen when setting the focus on different editor instances in the page.
\r
111 * @name CKEDITOR#currentInstance
\r