8
0

imagestyle.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global document, console, window */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import EnterPlugin from '@ckeditor/ckeditor5-enter/src/enter';
  8. import TypingPlugin from '@ckeditor/ckeditor5-typing/src/typing';
  9. import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  10. import HeadingPlugin from '@ckeditor/ckeditor5-heading/src/heading';
  11. import ImagePlugin from '../../src/image';
  12. import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo';
  13. import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
  14. import ImageStyle from '../../src/imagestyle';
  15. import ImageToolbar from '../../src/imagetoolbar';
  16. ClassicEditor
  17. .create( document.querySelector( '#editor-semantic' ), {
  18. plugins: [
  19. ImageToolbar,
  20. EnterPlugin,
  21. TypingPlugin,
  22. ParagraphPlugin,
  23. HeadingPlugin,
  24. ImagePlugin,
  25. UndoPlugin,
  26. ClipboardPlugin,
  27. ImageStyle
  28. ],
  29. toolbar: [ 'headings', 'undo', 'redo' ],
  30. image: {
  31. toolbar: [ 'imageStyleFull', 'imageStyleSide' ]
  32. }
  33. } )
  34. .then( editor => {
  35. window.editorSemantic = editor;
  36. } )
  37. .catch( err => {
  38. console.error( err.stack );
  39. } );
  40. ClassicEditor
  41. .create( document.querySelector( '#editor-formatting' ), {
  42. plugins: [
  43. ImageToolbar,
  44. EnterPlugin,
  45. TypingPlugin,
  46. ParagraphPlugin,
  47. HeadingPlugin,
  48. ImagePlugin,
  49. UndoPlugin,
  50. ClipboardPlugin,
  51. ImageStyle
  52. ],
  53. toolbar: [ 'headings', 'undo', 'redo' ],
  54. image: {
  55. styles: [ 'imageStyleAlignLeft', 'imageStyleAlignCenter', 'imageStyleAlignRight' ],
  56. toolbar: [ 'imageStyleAlignLeft', 'imageStyleAlignCenter', 'imageStyleAlignRight' ]
  57. }
  58. } )
  59. .then( editor => {
  60. window.editorFormatting = editor;
  61. } )
  62. .catch( err => {
  63. console.error( err.stack );
  64. } );