tableproperties.js 1.5 KB

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