mathtype.js 2.7 KB

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