8
0

autoformat.js 761 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console, window, document */
  6. import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';
  7. import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
  8. ClassicEditor
  9. .create( document.querySelector( '#snippet-autoformat' ), {
  10. plugins: ClassicEditor.build.plugins.concat( [ Code ] ),
  11. toolbar: {
  12. items: [
  13. 'headings',
  14. 'bold',
  15. 'italic',
  16. 'code',
  17. 'link',
  18. 'bulletedList',
  19. 'numberedList',
  20. 'blockQuote',
  21. 'undo',
  22. 'redo'
  23. ],
  24. viewportTopOffset: 60
  25. }
  26. } )
  27. .then( editor => {
  28. window.editorBasic = editor;
  29. } )
  30. .catch( err => {
  31. console.error( err );
  32. } );