]>
Commit | Line | Data |
---|---|---|
7adcb81e IB |
1 | /** |
2 | * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | |
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | |
4 | */ | |
5 | ||
6 | if ( !CKEDITOR.editor ) { | |
7 | // Documented at editor.js. | |
8 | CKEDITOR.editor = function() { | |
9 | // Push this editor to the pending list. It'll be processed later once | |
10 | // the full editor code is loaded. | |
11 | CKEDITOR._.pending.push( [ this, arguments ] ); | |
12 | ||
13 | // Call the CKEDITOR.event constructor to initialize this instance. | |
14 | CKEDITOR.event.call( this ); | |
15 | }; | |
16 | ||
17 | // Both fire and fireOnce will always pass this editor instance as the | |
18 | // "editor" param in CKEDITOR.event.fire. So, we override it to do that | |
19 | // automaticaly. | |
20 | CKEDITOR.editor.prototype.fire = function( eventName, data ) { | |
21 | if ( eventName in { instanceReady: 1, loaded: 1 } ) | |
22 | this[ eventName ] = true; | |
23 | ||
24 | return CKEDITOR.event.prototype.fire.call( this, eventName, data, this ); | |
25 | }; | |
26 | ||
27 | CKEDITOR.editor.prototype.fireOnce = function( eventName, data ) { | |
28 | if ( eventName in { instanceReady: 1, loaded: 1 } ) | |
29 | this[ eventName ] = true; | |
30 | ||
31 | return CKEDITOR.event.prototype.fireOnce.call( this, eventName, data, this ); | |
32 | }; | |
33 | ||
34 | // "Inherit" (copy actually) from CKEDITOR.event. | |
35 | CKEDITOR.event.implementOn( CKEDITOR.editor.prototype ); | |
36 | } |