tablestyles.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals console, window, document */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  8. import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
  9. import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
  10. import Indent from '@ckeditor/ckeditor5-indent/src/indent';
  11. const sourceElement = document.querySelector( '#editor' );
  12. const clonedSource = sourceElement.cloneNode( true );
  13. document.querySelector( '#cloned-source' ).append( ...clonedSource.childNodes );
  14. ClassicEditor
  15. .create( sourceElement, {
  16. plugins: [ ArticlePluginSet, Alignment, Indent, IndentBlock ],
  17. toolbar: [
  18. 'heading', '|', 'insertTable', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo'
  19. ],
  20. table: {
  21. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ],
  22. tableToolbar: [ 'bold', 'italic' ]
  23. }
  24. } )
  25. .then( editor => {
  26. window.editor = editor;
  27. } )
  28. .catch( err => {
  29. console.error( err.stack );
  30. } );