2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
6 // This file is not required by CKEditor and may be safely ignored.
7 // It is just a helper file that displays a red message about browser compatibility
8 // at the top of the samples (if incompatible browser is detected).
10 if ( window
.CKEDITOR
)
14 var showCompatibilityMsg = function()
16 var env
= CKEDITOR
.env
;
18 var html
= '<p><strong>Your browser is not compatible with CKEditor.</strong>';
22 gecko
: 'Firefox 2.0',
23 ie
: 'Internet Explorer 6.0',
28 var alsoBrowsers
= '';
30 for ( var key
in env
)
32 if ( browsers
[ key
] )
35 html
+= ' CKEditor is compatible with ' + browsers
[ key
] + ' or higher.';
37 alsoBrowsers
+= browsers
[ key
] + '+, ';
41 alsoBrowsers
= alsoBrowsers
.replace( /\+,([^,]+), $/, '+ and $1' );
43 html
+= ' It is also compatible with ' + alsoBrowsers
+ '.';
45 html
+= '</p><p>With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.</p>';
47 var alertsEl
= document
.getElementById( 'alerts' );
48 alertsEl
&& ( alertsEl
.innerHTML
= html
);
51 var onload = function()
53 // Show a friendly compatibility message as soon as the page is loaded,
54 // for those browsers that are not compatible with CKEditor.
55 if ( !CKEDITOR
.env
.isCompatible
)
56 showCompatibilityMsg();
59 // Register the onload listener.
60 if ( window
.addEventListener
)
61 window
.addEventListener( 'load', onload
, false );
62 else if ( window
.attachEvent
)
63 window
.attachEvent( 'onload', onload
);