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