codeblock.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  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. import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation';
  13. ClassicEditor
  14. .create( document.querySelector( '#editor' ), {
  15. plugins: [ Code, CodeBlock, Autoformat, Indent, ArticlePluginSet, TextTransformation ],
  16. toolbar: [
  17. 'heading', '|',
  18. 'bold', 'italic', 'code', 'blockQuote', 'codeBlock', '|',
  19. 'outdent', 'indent', '|',
  20. 'undo', 'redo',
  21. ]
  22. } )
  23. .then( editor => {
  24. window.editor = editor;
  25. } )
  26. .catch( err => {
  27. console.error( err.stack );
  28. } );