Nation Notes module contributed by Z&H Healthcare.
[openemr.git] / library / custom_template / ckeditor / _source / core / _bootstrap.js
blob22974c82ae9e4acbe59c095f22461d53095dee39
1 /*
2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
4 */
6 /**
7  * @fileOverview API initialization code.
8  */
10 (function()
12         // Disable HC detaction in WebKit. (#5429)
13         if ( CKEDITOR.env.webkit )
14         {
15                 CKEDITOR.env.hc = false;
16                 return;
17         }
19         // Check is High Contrast is active by creating a temporary element with a
20         // background image.
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)
37         try
38         {
39                 CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' );
40         }
41         catch (e)
42         {
43                 CKEDITOR.env.hc = false;
44         }
46         if ( CKEDITOR.env.hc )
47                 CKEDITOR.env.cssClass += ' cke_hc';
49         hcDetect.remove();
50 })();
52 // Load core plugins.
53 CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function()
54         {
55                 CKEDITOR.status = 'loaded';
56                 CKEDITOR.fire( 'loaded' );
58                 // Process all instances created by the "basic" implementation.
59                 var pending = CKEDITOR._.pending;
60                 if ( pending )
61                 {
62                         delete CKEDITOR._.pending;
64                         for ( var i = 0 ; i < pending.length ; i++ )
65                                 CKEDITOR.add( pending[ i ] );
66                 }
67         });
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.
73         try
74         {
75                 document.execCommand( 'BackgroundImageCache', false, true );
76         }
77         catch (e)
78         {
79                 // We have been reported about loading problems caused by the above
80                 // line. For safety, let's just ignore errors.
81         }
84 /**
85  * Indicates that CKEditor is running on a High Contrast environment.
86  * @name CKEDITOR.env.hc
87  * @example
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.' );
90  */
92 /**
93  * Fired when a CKEDITOR core object is fully loaded and ready for interaction.
94  * @name CKEDITOR#loaded
95  * @event
96  */