custom-heading-elements.js 914 B

1234567891011121314151617181920212223242526272829303132333435
  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-elements' ), {
  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. model: 'heading2fancy',
  15. view: {
  16. name: 'h2',
  17. class: 'fancy',
  18. priority: 'high'
  19. },
  20. title: 'Heading 2 (fancy)', class: 'ck-heading_heading2 fancy'
  21. }
  22. ]
  23. },
  24. toolbar: {
  25. viewportTopOffset: 60
  26. }
  27. } )
  28. .then( editor => {
  29. window.editor = editor;
  30. } )
  31. .catch( err => {
  32. console.error( err.stack );
  33. } );