input.js 725 B

123456789101112131415161718192021222324
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console, window, document */
  6. import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
  7. import { getData } from '/tests/engine/_utils/model.js';
  8. window.setInterval( function() {
  9. console.log( getData( window.editor.document ) );
  10. }, 3000 );
  11. ClassicEditor.create( document.querySelector( '#editor' ), {
  12. features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic', 'heading' ],
  13. toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
  14. } )
  15. .then( editor => {
  16. window.editor = editor;
  17. } )
  18. .catch( err => {
  19. console.error( err.stack );
  20. } );