custom-heading-buttons.js 1.2 KB

1234567891011121314151617181920212223242526
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals ClassicEditor, console, document, window */
  6. ClassicEditor
  7. .create( document.querySelector( '#snippet-custom-heading-buttons' ), {
  8. toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6', '|', 'undo', 'redo' ],
  9. heading: {
  10. options: [
  11. { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  12. { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
  13. { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
  14. { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
  15. { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
  16. { model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' },
  17. { model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' }
  18. ]
  19. }
  20. } )
  21. .then( editor => {
  22. window.editor = editor;
  23. } )
  24. .catch( err => {
  25. console.error( err.stack );
  26. } );