8
0

tablestyles.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. import TableStyle from '../../src/tablestyle';
  12. const sourceElement = document.querySelector( '#editor' );
  13. const clonedSource = sourceElement.cloneNode( true );
  14. document.querySelector( '#cloned-source' ).append( ...clonedSource.childNodes );
  15. ClassicEditor
  16. .create( sourceElement, {
  17. plugins: [ ArticlePluginSet, Alignment, Indent, IndentBlock, TableStyle ],
  18. toolbar: [
  19. 'heading', '|', 'insertTable', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo'
  20. ],
  21. table: {
  22. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableCellStyle' ],
  23. tableToolbar: [ 'bold', 'italic' ]
  24. }
  25. } )
  26. .then( editor => {
  27. window.editor = editor;
  28. } )
  29. .catch( err => {
  30. console.error( err.stack );
  31. } );