spellchecking.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  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.setInterval( function() {
  16. console.log( getData( window.editor.document ) );
  17. }, 3000 );
  18. ClassicEditor.create( document.querySelector( '#editor' ), {
  19. plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Heading ],
  20. toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
  21. } )
  22. .then( editor => {
  23. window.editor = editor;
  24. } )
  25. .catch( err => {
  26. console.error( err.stack );
  27. } );