2 * Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
\r
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
\r
6 // Tool scripts for the sample pages.
\r
7 // This file can be ignored and is not required to make use of CKEditor.
\r
10 // Check for sample compliance.
\r
11 CKEDITOR.on( 'instanceReady', function( ev ) {
\r
12 var editor = ev.editor,
\r
13 meta = CKEDITOR.document.$.getElementsByName( 'ckeditor-sample-required-plugins' ),
\r
14 requires = meta.length ? CKEDITOR.dom.element.get( meta[ 0 ] ).getAttribute( 'content' ).split( ',' ) : [],
\r
17 if ( requires.length ) {
\r
18 for ( var i = 0; i < requires.length; i++ ) {
\r
19 if ( !editor.plugins[ requires[ i ] ] )
\r
20 missing.push( '<code>' + requires[ i ] + '</code>' );
\r
23 if ( missing.length ) {
\r
24 var warn = CKEDITOR.dom.element.createFromHtml(
\r
25 '<div class="warning">' +
\r
26 '<span>To fully experience this demo, the ' + missing.join( ', ' ) + ' plugin' + ( missing.length > 1 ? 's are' : ' is' ) + ' required.</span>' +
\r
29 warn.insertBefore( editor.container );
\r