table-styling.js 973 B

1234567891011121314151617181920212223242526272829303132
  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 ClassicEditor, CKEditorPlugins, console, window, document */
  6. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  7. ClassicEditor
  8. .create( document.querySelector( '#snippet-table-styling' ), {
  9. extraPlugins: [
  10. CKEditorPlugins.TableProperties,
  11. CKEditorPlugins.TableCellProperties,
  12. ],
  13. cloudServices: CS_CONFIG,
  14. toolbar: {
  15. items: [
  16. 'insertTable', '|', 'heading', '|', 'bold', 'italic', '|', 'undo', 'redo'
  17. ],
  18. viewportTopOffset: window.getViewportTopOffsetConfig()
  19. },
  20. table: {
  21. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ]
  22. }
  23. } )
  24. .then( editor => {
  25. window.editorStyling = editor;
  26. } )
  27. .catch( err => {
  28. console.error( err.stack );
  29. } );