autoformat.js 894 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @license Copyright (c) 2003-2018, 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. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';
  9. ClassicEditor
  10. .create( document.querySelector( '#snippet-autoformat' ), {
  11. plugins: ClassicEditor.build.plugins.concat( [ Code ] ),
  12. toolbar: {
  13. items: [
  14. 'heading',
  15. '|',
  16. 'bold',
  17. 'italic',
  18. 'code',
  19. 'link',
  20. 'bulletedList',
  21. 'numberedList',
  22. 'blockQuote',
  23. 'undo',
  24. 'redo'
  25. ],
  26. viewportTopOffset: 60
  27. },
  28. cloudServices: CS_CONFIG
  29. } )
  30. .then( editor => {
  31. window.editorBasic = editor;
  32. } )
  33. .catch( err => {
  34. console.error( err );
  35. } );