JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.2
[ckeditor.git] / _source / core / env.js
index e992d3a..61df909 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -86,6 +86,15 @@ if ( !CKEDITOR.env )
                        mobile : ( agent.indexOf( 'mobile' ) > -1 ),\r
 \r
                        /**\r
+                        * Indicates that CKEditor is running on Apple iPhone/iPad/iPod devices.\r
+                        * @type Boolean\r
+                        * @example\r
+                        * if ( CKEDITOR.env.iOS )\r
+                        *     alert( "I like little apples!" );\r
+                        */\r
+                       iOS : /(ipad|iphone|ipod)/.test(agent),\r
+\r
+                       /**\r
                         * Indicates that the browser has a custom domain enabled. This has\r
                         * been set with "document.domain".\r
                         * @returns {Boolean} "true" if a custom domain is enabled.\r
@@ -103,7 +112,16 @@ if ( !CKEDITOR.env )
 \r
                                return domain != hostname &&\r
                                        domain != ( '[' + hostname + ']' );     // IPv6 IP support (#5434)\r
-                       }\r
+                       },\r
+\r
+                       /**\r
+                        * Indicates that page is running under an encrypted connection.\r
+                        * @returns {Boolean} "true" if the page has an encrypted connection.\r
+                        * @example\r
+                        * if ( CKEDITOR.env.secure )\r
+                        *     alert( "I'm in SSL!" );\r
+                        */\r
+                       secure : location.protocol == 'https:'\r
                };\r
 \r
                /**\r
@@ -146,6 +164,16 @@ if ( !CKEDITOR.env )
                        env.ie8Compat = document.documentMode == 8;\r
 \r
                        /**\r
+                        * Indicates that CKEditor is running on Internet Explorer 9's standards mode.\r
+                        * @name CKEDITOR.env.ie9Compat\r
+                        * @type Boolean\r
+                        * @example\r
+                        * if ( CKEDITOR.env.ie9Compat )\r
+                        *     alert( "IE9, the beauty of the web!" );\r
+                        */\r
+                       env.ie9Compat = document.documentMode == 9;\r
+\r
+                       /**\r
                         * Indicates that CKEditor is running on an IE7-like environment, which\r
                         * includes IE7 itself and IE8's IE7 document mode.\r
                         * @name CKEDITOR.env.ie7Compat\r
@@ -220,7 +248,12 @@ if ( !CKEDITOR.env )
                 *     alert( "Your browser is pretty cool!" );\r
                 */\r
                env.isCompatible =\r
+\r
+                       // White list of mobile devices that supports.\r
+                       env.iOS && version >= 534 ||\r
+\r
                        !env.mobile && (\r
+\r
                        ( env.ie && version >= 6 ) ||\r
                        ( env.gecko && version >= 10801 ) ||\r
                        ( env.opera && version >= 9.5 ) ||\r
@@ -241,7 +274,6 @@ if ( !CKEDITOR.env )
                                env.ie ? 'ie' :\r
                                env.gecko ? 'gecko' :\r
                                env.opera ? 'opera' :\r
-                               env.air ? 'air' :\r
                                env.webkit ? 'webkit' :\r
                                'unknown' );\r
 \r
@@ -262,6 +294,9 @@ if ( !CKEDITOR.env )
                if ( env.gecko && version < 10900 )\r
                        env.cssClass += ' cke_browser_gecko18';\r
 \r
+               if ( env.air )\r
+                       env.cssClass += ' cke_browser_air';\r
+\r
                return env;\r
        })();\r
 }\r