X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2F_bootstrap.js;h=c2a0cf7d179d899528ff00e2e9763db1e1238366;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=86e1fcee4b302b6f91da1d490b75dd7c0f9f3c2e;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/core/_bootstrap.js b/_source/core/_bootstrap.js index 86e1fce..c2a0cf7 100644 --- a/_source/core/_bootstrap.js +++ b/_source/core/_bootstrap.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -9,20 +9,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { - // Check is High Contrast is active by creating a temporary element with a - // background image. - - var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7, - useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7; - - - var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : - useBlank ? 'about:blank' : 'data:image/png;base64,'; + // Disable HC detaction in WebKit. (#5429) + if ( CKEDITOR.env.webkit ) + { + CKEDITOR.env.hc = false; + return; + } + // Check whether high contrast is active by creating a colored border. var hcDetect = CKEDITOR.dom.element.createFromHtml( - '
', CKEDITOR.document ); + '
', CKEDITOR.document ); hcDetect.appendTo( CKEDITOR.document.getHead() ); @@ -30,12 +27,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Catch exception needed sometimes for FF. (#4230) try { - CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ); + CKEDITOR.env.hc = hcDetect.getComputedStyle( 'border-top-color' ) == hcDetect.getComputedStyle( 'border-right-color' ); } catch (e) { CKEDITOR.env.hc = false; } + if ( CKEDITOR.env.hc ) CKEDITOR.env.cssClass += ' cke_hc'; @@ -59,9 +57,7 @@ CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function() } }); -/* -TODO: Enable the following and check if effective. - +// Needed for IE6 to not request image (HTTP 200 or 304) for every CSS background. (#6187) if ( CKEDITOR.env.ie ) { // Remove IE mouse flickering on IE6 because of background images. @@ -75,4 +71,17 @@ if ( CKEDITOR.env.ie ) // line. For safety, let's just ignore errors. } } -*/ + +/** + * Indicates that CKEditor is running on a High Contrast environment. + * @name CKEDITOR.env.hc + * @example + * if ( CKEDITOR.env.hc ) + * alert( 'You're running on High Contrast mode. The editor interface will get adapted to provide you a better experience.' ); + */ + +/** + * Fired when a CKEDITOR core object is fully loaded and ready for interaction. + * @name CKEDITOR#loaded + * @event + */