codeblock.js 784 B

12345678910111213141516171819202122
  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 '@ckeditor/ckeditor5-code-block/src/codeblock';
  9. ClassicEditor
  10. .create( document.querySelector( '#editor' ), {
  11. plugins: [ CodeBlock, ArticlePluginSet ],
  12. toolbar: [ 'heading', '|', 'bold', 'italic', 'blockQuote', 'codeBlock', 'undo', 'redo', 'insertTable' ]
  13. } )
  14. .then( editor => {
  15. window.editor = editor;
  16. } )
  17. .catch( err => {
  18. console.error( err.stack );
  19. } );