blocktoolbar.js 1.1 KB

1234567891011121314151617181920212223242526272829
  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 BlockToolbar from '@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar';
  8. import HeadingButtonsUI from '@ckeditor/ckeditor5-heading/src/headingbuttonsui';
  9. import ParagraphButtonUI from '@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui';
  10. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  11. ClassicEditor
  12. .create( document.querySelector( '#snippet-block-toolbar' ), {
  13. plugins: ClassicEditor.build.plugins.concat( [ BlockToolbar, ParagraphButtonUI, HeadingButtonsUI ] ),
  14. toolbar: {
  15. items: [ 'bold', 'italic', 'code', 'link', 'blockQuote', 'undo', 'redo' ],
  16. viewportTopOffset: 60
  17. },
  18. blockToolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', '|', 'bulletedList', 'numberedList' ],
  19. cloudServices: CS_CONFIG
  20. } )
  21. .then( editor => {
  22. window.editorBasic = editor;
  23. } )
  24. .catch( err => {
  25. console.error( err );
  26. } );