tableclipboard.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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, document, window, CKEditorInspector */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  8. import Table from '../../src/table';
  9. import TableToolbar from '../../src/tabletoolbar';
  10. import TableSelection from '../../src/tableselection';
  11. import TableClipboard from '../../src/tableclipboard';
  12. import TableProperties from '../../src/tableproperties';
  13. import TableCellProperties from '../../src/tablecellproperties';
  14. window.editors = {};
  15. createEditor( '#editor-content', 'content' );
  16. createEditor( '#editor-geometry', 'geometry' );
  17. function createEditor( target, inspectorName ) {
  18. ClassicEditor
  19. .create( document.querySelector( target ), {
  20. plugins: [ ArticlePluginSet, Table, TableToolbar, TableSelection, TableClipboard, TableProperties, TableCellProperties ],
  21. toolbar: [
  22. 'heading', '|',
  23. 'insertTable', '|',
  24. 'bold', 'italic', 'link', '|',
  25. 'bulletedList', 'numberedList', 'blockQuote', '|',
  26. 'undo', 'redo'
  27. ],
  28. table: {
  29. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ]
  30. }
  31. } )
  32. .then( editor => {
  33. window.editors[ inspectorName ] = editor;
  34. CKEditorInspector.attach( inspectorName, editor );
  35. } )
  36. .catch( err => {
  37. console.error( err.stack );
  38. } );
  39. }