custom-heading-levels.js 710 B

1234567891011121314151617181920212223
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals ClassicEditor, console, window, document */
  6. ClassicEditor
  7. .create( document.querySelector( '#snippet-custom-heading-levels' ), {
  8. heading: {
  9. options: [
  10. { modelElement: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  11. { modelElement: 'heading1', viewElement: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
  12. { modelElement: 'heading2', viewElement: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
  13. ]
  14. }
  15. } )
  16. .then( editor => {
  17. window.editor = editor;
  18. } )
  19. .catch( err => {
  20. console.error( err.stack );
  21. } );