tableproperties.js 1.4 KB

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