inverted.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals document, window, console */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
  8. import Enter from '@ckeditor/ckeditor5-enter/src/enter';
  9. import Typing from '@ckeditor/ckeditor5-typing/src/typing';
  10. import Heading from '@ckeditor/ckeditor5-heading/src/heading';
  11. import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  12. import Undo from '@ckeditor/ckeditor5-undo/src/undo';
  13. import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  14. import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  15. import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
  16. import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
  17. import Link from '@ckeditor/ckeditor5-link/src/link';
  18. const config = {
  19. plugins: [ Enter, Typing, Paragraph, Undo, Heading, Bold, Italic, Strikethrough, Code, Link ],
  20. toolbar: [ 'headings', '|', 'bold', 'italic', 'strikethrough', 'code', 'link', '|', 'undo', 'redo' ]
  21. };
  22. ClassicEditor
  23. .create( document.querySelector( '#editor-classic' ), config )
  24. .then( editor => {
  25. window.classicEditor = editor;
  26. } )
  27. .catch( err => {
  28. console.error( err.stack );
  29. } );
  30. BalloonEditor
  31. .create( document.querySelector( '#editor-balloon' ), config )
  32. .then( editor => {
  33. window.balloonEditor = editor;
  34. } )
  35. .catch( err => {
  36. console.error( err.stack );
  37. } );