classic-editor.js 754 B

12345678910111213141516171819202122232425
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console, window, document */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import ArticlePreset from '@ckeditor/ckeditor5-presets/src/article';
  8. ClassicEditor
  9. .create( document.querySelector( '#snippet-classic-editor' ), {
  10. plugins: [ ArticlePreset ],
  11. toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],
  12. image: {
  13. toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
  14. }
  15. } )
  16. .then( editor => {
  17. window.editor = editor;
  18. } )
  19. .catch( err => {
  20. console.error( err.stack );
  21. } );