[2000] | 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 | // Catch exception needed sometimes for FF. (#4230)
|
---|
| 26 | try
|
---|
| 27 | {
|
---|
| 28 | CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' );
|
---|
| 29 | }
|
---|
| 30 | catch (e)
|
---|
| 31 | {
|
---|
| 32 | CKEDITOR.env.hc = false;
|
---|
| 33 | }
|
---|
| 34 | if ( CKEDITOR.env.hc )
|
---|
| 35 | CKEDITOR.env.cssClass += ' cke_hc';
|
---|
| 36 |
|
---|
| 37 | hcDetect.remove();
|
---|
| 38 | })();
|
---|
| 39 |
|
---|
| 40 | // Load core plugins.
|
---|
| 41 | CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function()
|
---|
| 42 | {
|
---|
| 43 | CKEDITOR.status = 'loaded';
|
---|
| 44 | CKEDITOR.fire( 'loaded' );
|
---|
| 45 |
|
---|
| 46 | // Process all instances created by the "basic" implementation.
|
---|
| 47 | var pending = CKEDITOR._.pending;
|
---|
| 48 | if ( pending )
|
---|
| 49 | {
|
---|
| 50 | delete CKEDITOR._.pending;
|
---|
| 51 |
|
---|
| 52 | for ( var i = 0 ; i < pending.length ; i++ )
|
---|
| 53 | CKEDITOR.add( pending[ i ] );
|
---|
| 54 | }
|
---|
| 55 | });
|
---|
| 56 |
|
---|
| 57 | /*
|
---|
| 58 | TODO: Enable the following and check if effective.
|
---|
| 59 |
|
---|
| 60 | if ( CKEDITOR.env.ie )
|
---|
| 61 | {
|
---|
| 62 | // Remove IE mouse flickering on IE6 because of background images.
|
---|
| 63 | try
|
---|
| 64 | {
|
---|
| 65 | document.execCommand( 'BackgroundImageCache', false, true );
|
---|
| 66 | }
|
---|
| 67 | catch (e)
|
---|
| 68 | {
|
---|
| 69 | // We have been reported about loading problems caused by the above
|
---|
| 70 | // line. For safety, let's just ignore errors.
|
---|
| 71 | }
|
---|
| 72 | }
|
---|
| 73 | */
|
---|