custom-heading-levels.js 718 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @license Copyright (c) 2003-2018, 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. { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  11. { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
  12. { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
  13. ]
  14. },
  15. toolbar: {
  16. viewportTopOffset: 60
  17. }
  18. } )
  19. .then( editor => {
  20. window.editor = editor;
  21. } )
  22. .catch( err => {
  23. console.error( err.stack );
  24. } );