X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fenv.js;h=9f1f6d65ea20b799f7c9ea51bf7b1a04deddd988;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=20985278f01fa0ea9a6f2a7ce39e8da0f869f076;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/core/env.js b/_source/core/env.js index 2098527..9f1f6d6 100644 --- a/_source/core/env.js +++ b/_source/core/env.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -86,6 +86,15 @@ if ( !CKEDITOR.env ) mobile : ( agent.indexOf( 'mobile' ) > -1 ), /** + * Indicates that CKEditor is running on Apple iPhone/iPad/iPod devices. + * @type Boolean + * @example + * if ( CKEDITOR.env.iOS ) + * alert( "I like little apples!" ); + */ + iOS : /(ipad|iphone|ipod)/.test(agent), + + /** * Indicates that the browser has a custom domain enabled. This has * been set with "document.domain". * @returns {Boolean} "true" if a custom domain is enabled. @@ -103,7 +112,16 @@ if ( !CKEDITOR.env ) return domain != hostname && domain != ( '[' + hostname + ']' ); // IPv6 IP support (#5434) - } + }, + + /** + * Indicates that page is running under an encrypted connection. + * @returns {Boolean} "true" if the page has an encrypted connection. + * @example + * if ( CKEDITOR.env.secure ) + * alert( "I'm in SSL!" ); + */ + secure : location.protocol == 'https:' }; /** @@ -146,6 +164,16 @@ if ( !CKEDITOR.env ) env.ie8Compat = document.documentMode == 8; /** + * Indicates that CKEditor is running on Internet Explorer 9's standards mode. + * @name CKEDITOR.env.ie9Compat + * @type Boolean + * @example + * if ( CKEDITOR.env.ie9Compat ) + * alert( "IE9, the beauty of the web!" ); + */ + env.ie9Compat = document.documentMode == 9; + + /** * Indicates that CKEditor is running on an IE7-like environment, which * includes IE7 itself and IE8's IE7 document mode. * @name CKEDITOR.env.ie7Compat @@ -220,7 +248,12 @@ if ( !CKEDITOR.env ) * alert( "Your browser is pretty cool!" ); */ env.isCompatible = + + // White list of mobile devices that supports. + env.iOS && version >= 534 || + !env.mobile && ( + ( env.ie && version >= 6 ) || ( env.gecko && version >= 10801 ) || ( env.opera && version >= 9.5 ) || @@ -256,6 +289,9 @@ if ( !CKEDITOR.env ) if ( env.quirks ) env.cssClass += ' cke_browser_iequirks'; + + if ( document.documentMode && document.documentMode >=9 ) + env.cssClass += ' cke_browser_ie9plus'; } if ( env.gecko && version < 10900 )