captioning.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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/classic';
  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 ImageCaptioning from '../../src/imagecaptioning/imagecaptioning';
  13. import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo';
  14. import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
  15. import ImageToolbar from '../../src/imagetoolbar';
  16. ClassicEditor.create( document.querySelector( '#editor' ), {
  17. plugins: [
  18. EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin,
  19. UndoPlugin, ClipboardPlugin, ImageToolbar, ImageCaptioning
  20. ],
  21. toolbar: [ 'headings', 'undo', 'redo' ],
  22. image: {
  23. toolbar: [ 'imageAlternateText' ]
  24. }
  25. } )
  26. .then( editor => {
  27. window.editor = editor;
  28. } )
  29. .catch( err => {
  30. console.error( err.stack );
  31. } );