wproofreader.js 2.6 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 console:false, document, window */
  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 Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
  10. import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
  11. import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
  12. import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript';
  13. import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript';
  14. import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
  15. import Font from '@ckeditor/ckeditor5-font/src/font';
  16. import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
  17. import Indent from '@ckeditor/ckeditor5-indent/src/indent';
  18. import Mention from '@ckeditor/ckeditor5-mention/src/mention';
  19. import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice';
  20. import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat';
  21. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  22. ClassicEditor
  23. .create( document.querySelector( '#editor' ), {
  24. cloudServices: CS_CONFIG,
  25. plugins: [
  26. ArticlePluginSet,
  27. Alignment,
  28. Underline,
  29. Strikethrough,
  30. Code,
  31. Subscript,
  32. Superscript,
  33. EasyImage,
  34. Font,
  35. Highlight,
  36. Indent,
  37. Mention,
  38. PasteFromOffice,
  39. RemoveFormat,
  40. ],
  41. toolbar: [
  42. 'heading', 'fontFamily', 'fontSize', 'fontColor', 'fontBackgroundColor', 'highlight', 'alignment', '|',
  43. 'bold', 'italic', 'underline', 'strikethrough', 'code', 'subscript', 'superscript', 'removeFormat', '|',
  44. 'link', 'blockQuote', 'imageUpload', 'mediaEmbed', 'insertTable', '|',
  45. 'bulletedList', 'numberedList', 'indent', 'outdent', '|', 'undo', 'redo',
  46. '|'
  47. ],
  48. image: {
  49. toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
  50. },
  51. mediaEmbed: {
  52. previewsInData: true,
  53. toolbar: [ 'blockQuote' ]
  54. },
  55. mention: {
  56. feeds: [ {
  57. marker: '@',
  58. feed: [ '@Barney', '@Lily', '@Marshall', '@Robin', '@Ted' ]
  59. } ]
  60. },
  61. table: {
  62. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ],
  63. tableToolbar: [ 'bold', 'italic' ]
  64. }
  65. } )
  66. .then( newEditor => {
  67. window.editor = newEditor;
  68. } )
  69. .catch( err => {
  70. console.error( err.stack );
  71. } );