2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
7 * @fileOverview API initialization code.
12 // Disable HC detaction in WebKit. (#5429)
13 if ( CKEDITOR.env.webkit )
15 CKEDITOR.env.hc = false;
19 // Check is High Contrast is active by creating a temporary element with a
22 var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7,
23 useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7;
25 var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) :
26 useBlank ? 'about:blank' : 'data:image/png;base64,';
28 var hcDetect = CKEDITOR.dom.element.createFromHtml(
29 '<div style="width:0px;height:0px;' +
30 'position:absolute;left:-10000px;' +
31 'background-image:url(' + backgroundImageUrl + ')"></div>', CKEDITOR.document );
33 hcDetect.appendTo( CKEDITOR.document.getHead() );
35 // Update CKEDITOR.env.
36 // Catch exception needed sometimes for FF. (#4230)
39 CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' );
43 CKEDITOR.env.hc = false;
46 if ( CKEDITOR.env.hc )
47 CKEDITOR.env.cssClass += ' cke_hc';
53 CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function()
55 CKEDITOR.status = 'loaded';
56 CKEDITOR.fire( 'loaded' );
58 // Process all instances created by the "basic" implementation.
59 var pending = CKEDITOR._.pending;
62 delete CKEDITOR._.pending;
64 for ( var i = 0 ; i < pending.length ; i++ )
65 CKEDITOR.add( pending[ i ] );
69 // Needed for IE6 to not request image (HTTP 200 or 304) for every CSS background. (#6187)
70 if ( CKEDITOR.env.ie )
72 // Remove IE mouse flickering on IE6 because of background images.
75 document.execCommand( 'BackgroundImageCache', false, true );
79 // We have been reported about loading problems caused by the above
80 // line. For safety, let's just ignore errors.
85 * Indicates that CKEditor is running on a High Contrast environment.
86 * @name CKEDITOR.env.hc
88 * if ( CKEDITOR.env.hc )
89 * alert( 'You're running on High Contrast mode. The editor interface will get adapted to provide you a better experience.' );
93 * Fired when a CKEDITOR core object is fully loaded and ready for interaction.
94 * @name CKEDITOR#loaded