Sha256: ecc725f5425d8006f9e98541e04609d661817aef82a3046a2708e855abd586ad

Contents?: true

Size: 1.82 KB

Versions: 91

Compression:

Stored size: 1.82 KB

Contents

/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

// This file is not required by CKEditor and may be safely ignored.
// It is just a helper file that displays a red message about browser compatibility
// at the top of the samples (if incompatible browser is detected).

if ( window.CKEDITOR )
{
	(function()
	{
		var showCompatibilityMsg = function()
		{
			var env = CKEDITOR.env;

			var html = '<p><strong>Your browser is not compatible with CKEditor.</strong>';

			var browsers =
			{
				gecko : 'Firefox 2.0',
				ie : 'Internet Explorer 6.0',
				opera : 'Opera 9.5',
				webkit : 'Safari 3.0'
			};

			var alsoBrowsers = '';

			for ( var key in env )
			{
				if ( browsers[ key ] )
				{
					if ( env[key] )
						html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.';
					else
						alsoBrowsers += browsers[ key ] + '+, ';
				}
			}

			alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' );

			html += ' It is also compatible with ' + alsoBrowsers + '.';

			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>';

			var alertsEl = document.getElementById( 'alerts' );
			alertsEl && ( alertsEl.innerHTML = html );
		};

		var onload = function()
		{
			// Show a friendly compatibility message as soon as the page is loaded,
			// for those browsers that are not compatible with CKEditor.
			if ( !CKEDITOR.env.isCompatible )
				showCompatibilityMsg();
		};

		// Register the onload listener.
		if ( window.addEventListener )
			window.addEventListener( 'load', onload, false );
		else if ( window.attachEvent )
			window.attachEvent( 'onload', onload );
	})();
}

Version data entries

91 entries across 88 versions & 10 rubygems

Version Path
classiccms-0.5.14 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.13 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.12 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.11 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.10 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.9 lib/classiccms/public/js/ckeditor/_samples/sample.js
radiant-ck_editor_filter-extension-0.2.7 public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/sample.js
classiccms-0.5.8 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.7 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.6 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.5 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.2 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.1 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.5.0 lib/classiccms/public/js/ckeditor/_samples/sample.js
atrium-0.0.1 app/assets/javascripts/ckeditor.warning.js
atrium-0.0.1.alpha app/assets/javascripts/ckeditor.warning.js
classiccms-0.4.2 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.4.1 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.4.0 lib/classiccms/public/js/ckeditor/_samples/sample.js
classiccms-0.3.9 lib/classiccms/public/js/ckeditor/_samples/sample.js