autoformat.js 1.0 KB

12345678910111213141516171819202122232425262728
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console, window, document */
  6. import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
  7. import Autoformat from '/ckeditor5/autoformat/autoformat.js';
  8. import Enter from '/ckeditor5/enter/enter.js';
  9. import List from '/ckeditor5/list/list.js';
  10. import Typing from '/ckeditor5/typing/typing.js';
  11. import Heading from '/ckeditor5/heading/heading.js';
  12. import Paragraph from '/ckeditor5/paragraph/paragraph.js';
  13. import Undo from '/ckeditor5/undo/undo.js';
  14. import Bold from '/ckeditor5/basic-styles/bold.js';
  15. import Italic from '/ckeditor5/basic-styles/italic.js';
  16. ClassicEditor.create( document.querySelector( '#editor' ), {
  17. features: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Heading, List, Autoformat ],
  18. toolbar: [ 'headings', 'numberedList', 'bulletedList', 'bold', 'italic', 'undo', 'redo' ]
  19. } )
  20. .then( editor => {
  21. window.editor = editor;
  22. } )
  23. .catch( err => {
  24. console.error( err.stack );
  25. } );