table.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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, 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' ), {
  9. cloudServices: CS_CONFIG,
  10. toolbar: {
  11. items: [
  12. 'insertTable',
  13. '|',
  14. 'fontFamily', 'fontSize',
  15. '|',
  16. 'bold', 'italic',
  17. '|',
  18. 'alignment:left', 'alignment:center', 'alignment:right', 'alignment:justify',
  19. '|',
  20. 'bulletedList', 'numberedList',
  21. '|',
  22. 'indent', 'outdent',
  23. '|',
  24. 'link', 'blockQuote',
  25. '|',
  26. 'undo', 'redo'
  27. ],
  28. viewportTopOffset: window.getViewportTopOffsetConfig()
  29. },
  30. table: {
  31. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
  32. }
  33. } )
  34. .then( editor => {
  35. window.editor = editor;
  36. } )
  37. .catch( err => {
  38. console.error( err.stack );
  39. } );