]>
git.immae.eu Git - perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git/blob - sources/core/ckeditor_basic.js
c07e4d980de54b1edeca9c43f05b3b66e52805f5
2 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
7 * @fileOverview Contains the second part of the {@link CKEDITOR} object
8 * definition, which defines the basic editor features to be available in
9 * the root ckeditor_basic.js file.
12 if ( CKEDITOR
.status
== 'unloaded' ) {
14 CKEDITOR
.event
.implementOn( CKEDITOR
);
17 * Forces the full CKEditor core code, in the case only the basic code has been
18 * loaded (`ckeditor_basic.js`). This method self-destroys (becomes undefined) in
19 * the first call or as soon as the full code is available.
21 * // Check if the full core code has been loaded and load it.
22 * if ( CKEDITOR.loadFullCore )
23 * CKEDITOR.loadFullCore();
27 CKEDITOR
.loadFullCore = function() {
28 // If the basic code is not ready, just mark it to be loaded.
29 if ( CKEDITOR
.status
!= 'basic_ready' ) {
30 CKEDITOR
.loadFullCore
._load
= 1;
34 // Destroy this function.
35 delete CKEDITOR
.loadFullCore
;
37 // Append the script to the head.
38 var script
= document
.createElement( 'script' );
39 script
.type
= 'text/javascript';
40 script
.src
= CKEDITOR
.basePath
+ 'ckeditor.js';
41 script
.src
= CKEDITOR
.basePath
+ 'ckeditor_source.js'; // %REMOVE_LINE%
43 document
.getElementsByTagName( 'head' )[ 0 ].appendChild( script
);
47 * The time to wait (in seconds) to load the full editor code after the
48 * page load, if the "ckeditor_basic" file is used. If set to zero, the
49 * editor is loaded on demand, as soon as an instance is created.
51 * This value must be set on the page before the page load completion.
53 * // Loads the full source after five seconds.
54 * CKEDITOR.loadFullCoreTimeout = 5;
59 CKEDITOR
.loadFullCoreTimeout
= 0;
61 // Documented at ckeditor.js.
62 CKEDITOR
.add = function( editor
) {
63 // For now, just put the editor in the pending list. It will be
64 // processed as soon as the full code gets loaded.
65 var pending
= this._
.pending
|| ( this._
.pending
= [] );
66 pending
.push( editor
);
70 var onload = function() {
71 var loadFullCore
= CKEDITOR
.loadFullCore
,
72 loadFullCoreTimeout
= CKEDITOR
.loadFullCoreTimeout
;
77 CKEDITOR
.status
= 'basic_ready';
79 if ( loadFullCore
&& loadFullCore
._load
)
81 else if ( loadFullCoreTimeout
) {
82 setTimeout( function() {
83 if ( CKEDITOR
.loadFullCore
)
84 CKEDITOR
.loadFullCore();
85 }, loadFullCoreTimeout
* 1000 );
89 CKEDITOR
.domReady( onload
);
92 CKEDITOR
.status
= 'basic_loaded';