heading-buttons.js 891 B

1234567891011121314151617181920212223
  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-heading-buttons' ), {
  8. toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3', '|', '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. ]
  16. }
  17. } )
  18. .then( editor => {
  19. window.editor = editor;
  20. } )
  21. .catch( err => {
  22. console.error( err.stack );
  23. } );