codeblock.js 1.0 KB

1234567891011121314151617181920212223242526272829
  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. /* 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', 'undo', 'redo', 'insertTable', '|',
  18. 'outdent', 'indent',
  19. ]
  20. } )
  21. .then( editor => {
  22. window.editor = editor;
  23. } )
  24. .catch( err => {
  25. console.error( err.stack );
  26. } );