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 API initialization code.
\r
12 // Disable HC detaction in WebKit. (#5429)
\r
13 if ( CKEDITOR.env.webkit )
\r
15 CKEDITOR.env.hc = false;
\r
19 // Check is High Contrast is active by creating a temporary element with a
\r
20 // background image.
\r
22 var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7,
\r
23 useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7;
\r
25 var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) :
\r
26 useBlank ? 'about:blank' : 'data:image/png;base64,';
\r
28 var hcDetect = CKEDITOR.dom.element.createFromHtml(
\r
29 '<div style="width:0px;height:0px;' +
\r
30 'position:absolute;left:-10000px;' +
\r
31 'background-image:url(' + backgroundImageUrl + ')"></div>', CKEDITOR.document );
\r
33 hcDetect.appendTo( CKEDITOR.document.getHead() );
\r
35 // Update CKEDITOR.env.
\r
36 // Catch exception needed sometimes for FF. (#4230)
\r
39 CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' );
\r
43 CKEDITOR.env.hc = false;
\r
46 if ( CKEDITOR.env.hc )
\r
47 CKEDITOR.env.cssClass += ' cke_hc';
\r
52 // Load core plugins.
\r
53 CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function()
\r
55 CKEDITOR.status = 'loaded';
\r
56 CKEDITOR.fire( 'loaded' );
\r
58 // Process all instances created by the "basic" implementation.
\r
59 var pending = CKEDITOR._.pending;
\r
62 delete CKEDITOR._.pending;
\r
64 for ( var i = 0 ; i < pending.length ; i++ )
\r
65 CKEDITOR.add( pending[ i ] );
\r
70 TODO: Enable the following and check if effective.
\r
72 if ( CKEDITOR.env.ie )
\r
74 // Remove IE mouse flickering on IE6 because of background images.
\r
77 document.execCommand( 'BackgroundImageCache', false, true );
\r
81 // We have been reported about loading problems caused by the above
\r
82 // line. For safety, let's just ignore errors.
\r
88 * Fired when a CKEDITOR core object is fully loaded and ready for interaction.
\r
89 * @name CKEDITOR#loaded
\r