1.js 799 B

1234567891011121314151617181920212223242526
  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/classic';
  7. import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
  8. import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  9. import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
  10. window.setInterval( function() {
  11. console.log( getData( window.editor.document ) );
  12. }, 3000 );
  13. ClassicEditor.create( document.querySelector( '#editor' ), {
  14. plugins: [ EssentialsPreset, Paragraph ],
  15. toolbar: [ 'undo', 'redo' ]
  16. } )
  17. .then( editor => {
  18. window.editor = editor;
  19. } )
  20. .catch( err => {
  21. console.error( err.stack );
  22. } );