custom-heading-levels.js 929 B

1234567891011121314151617181920212223242526272829
  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, window, document */
  6. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  7. ClassicEditor
  8. .create( document.querySelector( '#snippet-custom-heading-levels' ), {
  9. cloudServices: CS_CONFIG,
  10. heading: {
  11. options: [
  12. { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  13. { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
  14. { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }
  15. ]
  16. },
  17. toolbar: {
  18. viewportTopOffset: window.getViewportTopOffsetConfig()
  19. }
  20. } )
  21. .then( editor => {
  22. window.editor = editor;
  23. } )
  24. .catch( err => {
  25. console.error( err.stack );
  26. } );