8
0

codeblock.js 1017 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. /* global document, console, window */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  8. import CodeBlock from '../../src/codeblock';
  9. import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
  10. import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
  11. import Indent from '@ckeditor/ckeditor5-indent/src/indent';
  12. ClassicEditor
  13. .create( document.querySelector( '#editor' ), {
  14. plugins: [ Code, CodeBlock, Autoformat, Indent, ArticlePluginSet ],
  15. toolbar: [
  16. 'heading', '|',
  17. 'bold', 'italic', 'code', 'blockQuote', 'codeBlock', '|',
  18. 'outdent', 'indent', '|',
  19. 'undo', 'redo'
  20. ]
  21. } )
  22. .then( editor => {
  23. window.editor = editor;
  24. } )
  25. .catch( err => {
  26. console.error( err.stack );
  27. } );