Path: blob/master/web-gui/buildyourownbotnet/assets/js/ckeditor/samples/sample.js
1293 views
/**1* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.2* For licensing, see LICENSE.md or http://ckeditor.com/license3*/45// Tool scripts for the sample pages.6// This file can be ignored and is not required to make use of CKEditor.78(function() {9CKEDITOR.on( 'instanceReady', function( ev ) {10// Check for sample compliance.11var editor = ev.editor,12meta = CKEDITOR.document.$.getElementsByName( 'ckeditor-sample-required-plugins' ),13requires = meta.length ? CKEDITOR.dom.element.get( meta[ 0 ] ).getAttribute( 'content' ).split( ',' ) : [],14missing = [],15i;1617if ( requires.length ) {18for ( i = 0; i < requires.length; i++ ) {19if ( !editor.plugins[ requires[ i ] ] )20missing.push( '<code>' + requires[ i ] + '</code>' );21}2223if ( missing.length ) {24var warn = CKEDITOR.dom.element.createFromHtml(25'<div class="warning">' +26'<span>To fully experience this demo, the ' + missing.join( ', ' ) + ' plugin' + ( missing.length > 1 ? 's are' : ' is' ) + ' required.</span>' +27'</div>'28);29warn.insertBefore( editor.container );30}31}3233// Set icons.34var doc = new CKEDITOR.dom.document( document ),35icons = doc.find( '.button_icon' );3637for ( i = 0; i < icons.count(); i++ ) {38var icon = icons.getItem( i ),39name = icon.getAttribute( 'data-icon' ),40style = CKEDITOR.skin.getIconStyle( name, ( CKEDITOR.lang.dir == 'rtl' ) );4142icon.addClass( 'cke_button_icon' );43icon.addClass( 'cke_button__' + name + '_icon' );44icon.setAttribute( 'style', style );45icon.setStyle( 'float', 'none' );4647}48} );49})();505152