1.js 970 B

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