@@ -17,9 +17,9 @@ if ( !CKEDITOR.env ) {
17
17
*/
18
18
CKEDITOR . env = ( function ( ) {
19
19
var agent = navigator . userAgent . toLowerCase ( ) ,
20
- spartan = agent . match ( / e d g e [ \/ ] ( \d + .? \d * ) / ) ,
20
+ edge = agent . match ( / e d g e [ \/ ] ( \d + .? \d * ) / ) ,
21
21
trident = agent . indexOf ( 'trident/' ) > - 1 ,
22
- ie = ! ! ( spartan || trident ) ;
22
+ ie = ! ! ( edge || trident ) ;
23
23
24
24
var env = {
25
25
/**
@@ -28,12 +28,29 @@ if ( !CKEDITOR.env ) {
28
28
* if ( CKEDITOR.env.ie )
29
29
* alert( 'I\'m running in IE!' );
30
30
*
31
+ * **Note:** This property is also set to `true` if CKEditor is running
32
+ * in {@link #edge Microsoft Edge}.
33
+ *
31
34
* @property {Boolean }
32
35
*/
33
36
ie : ie ,
34
37
35
38
/**
36
- * Indicates that CKEditor is running in a WebKit-based browser, like Safari.
39
+ * Indicates that CKEditor is running in Microsoft Edge.
40
+ *
41
+ * if ( CKEDITOR.env.edge )
42
+ * alert( 'I\'m running in Edge!' );
43
+ *
44
+ * See also {@link #ie}.
45
+ *
46
+ * @since 4.5
47
+ * @property {Boolean }
48
+ */
49
+ edge : ! ! edge ,
50
+
51
+ /**
52
+ * Indicates that CKEditor is running in a WebKit-based browser, like Safari,
53
+ * or Blink-based browser, like Blink.
37
54
*
38
55
* if ( CKEDITOR.env.webkit )
39
56
* alert( 'I\'m running in a WebKit browser!' );
@@ -144,7 +161,7 @@ if ( !CKEDITOR.env ) {
144
161
env . gecko = ( navigator . product == 'Gecko' && ! env . webkit && ! env . ie ) ;
145
162
146
163
/**
147
- * Indicates that CKEditor is running in Chrome.
164
+ * Indicates that CKEditor is running in Blink-based browsers like Chrome.
148
165
*
149
166
* if ( CKEDITOR.env.chrome )
150
167
* alert( 'I\'m running in Chrome!' );
@@ -172,8 +189,8 @@ if ( !CKEDITOR.env ) {
172
189
// Internet Explorer 6.0+
173
190
if ( env . ie ) {
174
191
// We use env.version for feature detection, so set it properly.
175
- if ( spartan ) {
176
- version = parseFloat ( spartan [ 1 ] ) ;
192
+ if ( edge ) {
193
+ version = parseFloat ( edge [ 1 ] ) ;
177
194
} else if ( env . quirks || ! document . documentMode ) {
178
195
version = parseFloat ( agent . match ( / m s i e ( \d + ) / ) [ 1 ] ) ;
179
196
} else {
@@ -258,26 +275,28 @@ if ( !CKEDITOR.env ) {
258
275
env . version = version ;
259
276
260
277
/**
261
- * Indicates that CKEditor is running in a compatible browser.
278
+ * Since CKEditor 4.5.0 this property is a blacklist of browsers incompatible with CKEditor. It means that it is
279
+ * set to `false` only in browsers that are known to be incompatible. Before CKEditor 4.5.0 this
280
+ * property was a whitelist of browsers that were known to be compatible with CKEditor.
262
281
*
263
- * if ( CKEDITOR.env.isCompatible )
264
- * alert( 'Your browser is pretty cool!' );
282
+ * The reason for this change is the rising fragmentation of the browsers market (especially the mobile segment).
283
+ * It became too complicated to check on which new environments CKEditor is going to work.
265
284
*
266
- * See the [Enabling CKEditor in Unsupported Environments](#!/guide/dev_unsupported_environments)
267
- * article for more information.
285
+ * In order to enable CKEditor 4.4.x and below in unsupported environment see the
286
+ * [Enabling CKEditor in Unsupported Environments](#!/guide/dev_unsupported_environments) article.
287
+ *
288
+ * if ( CKEDITOR.env.isCompatible )
289
+ * alert( 'Your browser is not known to be incompatible with CKEditor!' );
268
290
*
269
291
* @property {Boolean }
270
292
*/
271
293
env . isCompatible =
272
- // White list of mobile devices that CKEditor supports.
273
- env . iOS && version >= 534 ||
274
- ! env . mobile && (
275
- ( env . ie && version > 6 ) ||
276
- ( env . gecko && version >= 20000 ) ||
277
- ( env . air && version >= 1 ) ||
278
- ( env . webkit && version >= 522 ) ||
279
- false
280
- ) ;
294
+ // IE 7+ (IE 7 is not supported, but IE Compat Mode is and it is recognized as IE7).
295
+ ! ( env . ie && version < 7 ) &&
296
+ // Firefox 4.0+.
297
+ ! ( env . gecko && version < 40000 ) &&
298
+ // Chrome 6+, Safari 5.1+, iOS 5+.
299
+ ! ( env . webkit && version < 534 ) ;
281
300
282
301
/**
283
302
* Indicates that CKEditor is running in the HiDPI environment.
0 commit comments