paste-from-office.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-paste-from-office' ), {
  9. toolbar: {
  10. items: [
  11. 'heading',
  12. '|',
  13. 'fontSize',
  14. 'fontFamily',
  15. 'fontColor',
  16. 'fontBackgroundColor',
  17. '|',
  18. 'bold',
  19. 'italic',
  20. 'underline',
  21. 'strikethrough',
  22. '|',
  23. 'alignment',
  24. '|',
  25. 'numberedList',
  26. 'bulletedList',
  27. '|',
  28. 'indent',
  29. 'outdent',
  30. '|',
  31. 'link',
  32. 'imageUpload',
  33. 'insertTable',
  34. 'horizontalLine',
  35. '|',
  36. 'undo',
  37. 'redo'
  38. ],
  39. viewportTopOffset: window.getViewportTopOffsetConfig()
  40. },
  41. image: {
  42. styles: [
  43. 'full',
  44. 'alignLeft',
  45. 'alignRight'
  46. ],
  47. toolbar: [
  48. 'imageStyle:alignLeft',
  49. 'imageStyle:full',
  50. 'imageStyle:alignRight',
  51. '|',
  52. 'imageTextAlternative'
  53. ]
  54. },
  55. table: {
  56. contentToolbar: [
  57. 'tableColumn',
  58. 'tableRow',
  59. 'mergeTableCells',
  60. 'tableProperties',
  61. 'tableCellProperties'
  62. ]
  63. },
  64. placeholder: 'Paste the content here to test the feature.',
  65. cloudServices: CS_CONFIG
  66. } )
  67. .then( editor => {
  68. window.editor = editor;
  69. } )
  70. .catch( err => {
  71. console.error( err.stack );
  72. } );