]>
git.immae.eu Git - perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git/blob - sources/core/_bootstrap.js
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 API initialization code.
11 // Disable HC detection in WebKit. (http://dev.ckeditor.com/ticket/5429)
12 if ( CKEDITOR
.env
.webkit
)
13 CKEDITOR
.env
.hc
= false;
15 // Check whether high contrast is active by creating a colored border.
16 var hcDetect
= CKEDITOR
.dom
.element
.createFromHtml( '<div style="width:0;height:0;position:absolute;left:-10000px;' +
17 'border:1px solid;border-color:red blue"></div>', CKEDITOR
.document
);
19 hcDetect
.appendTo( CKEDITOR
.document
.getHead() );
21 // Update CKEDITOR.env.
22 // Catch exception needed sometimes for FF. (http://dev.ckeditor.com/ticket/4230)
24 var top
= hcDetect
.getComputedStyle( 'border-top-color' ),
25 right
= hcDetect
.getComputedStyle( 'border-right-color' );
27 // We need to check if getComputedStyle returned any value, because on FF
28 // it returnes empty string if CKEditor is loaded in hidden iframe. (http://dev.ckeditor.com/ticket/11121)
29 CKEDITOR
.env
.hc
= !!( top
&& top
== right
);
31 CKEDITOR
.env
.hc
= false;
37 if ( CKEDITOR
.env
.hc
)
38 CKEDITOR
.env
.cssClass
+= ' cke_hc';
40 // Initially hide UI spaces when relevant skins are loading, later restored by skin css.
41 CKEDITOR
.document
.appendStyleText( '.cke{visibility:hidden;}' );
43 // Mark the editor as fully loaded.
44 CKEDITOR
.status
= 'loaded';
45 CKEDITOR
.fireOnce( 'loaded' );
47 // Process all instances created by the "basic" implementation.
48 var pending
= CKEDITOR
._
.pending
;
50 delete CKEDITOR
._
.pending
;
52 for ( var i
= 0; i
< pending
.length
; i
++ ) {
53 CKEDITOR
.editor
.prototype.constructor.apply( pending
[ i
][ 0 ], pending
[ i
][ 1 ] );
54 CKEDITOR
.add( pending
[ i
][ 0 ] );
60 * Indicates that CKEditor is running on a High Contrast environment.
62 * if ( CKEDITOR.env.hc )
63 * alert( 'You\'re running on High Contrast mode. The editor interface will get adapted to provide you a better experience.' );
65 * @property {Boolean} hc
66 * @member CKEDITOR.env
70 * Fired when a CKEDITOR core object is fully loaded and ready for interaction.