X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2F_bootstrap.js;h=f351ce616a7ba633718ebf87a8e3c0b197f96ed3;hb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;hp=6c0440dde9ee4319478c9c48d7cc046b909a8125;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/core/_bootstrap.js b/_source/core/_bootstrap.js index 6c0440d..f351ce6 100644 --- a/_source/core/_bootstrap.js +++ b/_source/core/_bootstrap.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -9,20 +9,41 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { + // Disable HC detaction in WebKit. (#5429) + if ( CKEDITOR.env.webkit ) + { + CKEDITOR.env.hc = false; + return; + } + // Check is High Contrast is active by creating a temporary element with a // background image. - var testImage = ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : 'about:blank'; + 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,'; var hcDetect = CKEDITOR.dom.element.createFromHtml( '
', CKEDITOR.document ); + 'background-image:url(' + backgroundImageUrl + ')">', CKEDITOR.document ); hcDetect.appendTo( CKEDITOR.document.getHead() ); // Update CKEDITOR.env. - if ( ( CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ) ) ) + // Catch exception needed sometimes for FF. (#4230) + try + { + CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ); + } + catch (e) + { + CKEDITOR.env.hc = false; + } + + if ( CKEDITOR.env.hc ) CKEDITOR.env.cssClass += ' cke_hc'; hcDetect.remove(); @@ -62,3 +83,9 @@ if ( CKEDITOR.env.ie ) } } */ + +/** + * Fired when a CKEDITOR core object is fully loaded and ready for interaction. + * @name CKEDITOR#loaded + * @event + */