default-headings.js 1013 B

123456789101112131415161718192021222324252627282930
  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-default-headings' ), {
  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. { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }
  16. ]
  17. },
  18. toolbar: {
  19. viewportTopOffset: window.getViewportTopOffsetConfig()
  20. }
  21. } )
  22. .then( editor => {
  23. window.editor = editor;
  24. } )
  25. .catch( err => {
  26. console.error( err.stack );
  27. } );