1 /*
  2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
  3 For licensing, see LICENSE.html or http://ckeditor.com/license
  4 */
  5
  6 /**
  7  * @fileOverview API initialization code.
  8  */
  9
 10 (function()
 11 {
 12 	// Check is High Contrast is active by creating a temporary element with a
 13 	// background image.
 14
 15 	var testImage = ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : 'about:blank';
 16
 17 	var hcDetect = CKEDITOR.dom.element.createFromHtml(
 18 		'<div style="width:0px;height:0px;' +
 19 			'position:absolute;left:-10000px;' +
 20 			'background-image:url(' + testImage + ')"></div>', CKEDITOR.document );
 21
 22 	hcDetect.appendTo( CKEDITOR.document.getHead() );
 23
 24 	// Update CKEDITOR.env.
 25 	if ( ( CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ) ) )
 26 		CKEDITOR.env.cssClass += ' cke_hc';
 27
 28 	hcDetect.remove();
 29 })();
 30
 31 // Load core plugins.
 32 CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function()
 33 	{
 34 		CKEDITOR.status = 'loaded';
 35 		CKEDITOR.fire( 'loaded' );
 36
 37 		// Process all instances created by the "basic" implementation.
 38 		var pending = CKEDITOR._.pending;
 39 		if ( pending )
 40 		{
 41 			delete CKEDITOR._.pending;
 42
 43 			for ( var i = 0 ; i < pending.length ; i++ )
 44 				CKEDITOR.add( pending[ i ] );
 45 		}
 46 	});
 47
 48 /*
 49 TODO: Enable the following and check if effective.
 50
 51 if ( CKEDITOR.env.ie )
 52 {
 53 	// Remove IE mouse flickering on IE6 because of background images.
 54 	try
 55 	{
 56 		document.execCommand( 'BackgroundImageCache', false, true );
 57 	}
 58 	catch (e)
 59 	{
 60 		// We have been reported about loading problems caused by the above
 61 		// line. For safety, let's just ignore errors.
 62 	}
 63 }
 64 */
 65