code-block.js 814 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @license Copyright (c) 2003-2019, 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-highlight' ), {
  9. cloudServices: CS_CONFIG,
  10. toolbar: {
  11. items: [
  12. 'heading',
  13. '|',
  14. 'bulletedList',
  15. 'numberedList',
  16. '|',
  17. 'code',
  18. 'codeBlock',
  19. '|',
  20. 'outdent',
  21. 'indent',
  22. '|',
  23. 'undo',
  24. 'redo'
  25. ],
  26. viewportTopOffset: window.getViewportTopOffsetConfig()
  27. }
  28. } )
  29. .then( editor => {
  30. window.editor = editor;
  31. } )
  32. .catch( err => {
  33. console.error( err.stack );
  34. } );