custom-heading-elements.js 917 B

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