8
0

tableproperties.js 1.6 KB

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