delete.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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 Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  13. import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  14. import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
  15. window.getData = getData;
  16. window.setInterval( function() {
  17. console.log( getData( window.editor.document ) );
  18. }, 3000 );
  19. ClassicEditor.create( document.querySelector( '#editor' ), {
  20. plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Heading ],
  21. toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
  22. } )
  23. .then( editor => {
  24. window.editor = editor;
  25. } )
  26. .catch( err => {
  27. console.error( err.stack );
  28. } );