rtl.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. const config = {
  9. features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic', 'heading' ],
  10. toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
  11. };
  12. window.setInterval( function() {
  13. if ( window.editor1.editing.view.isFocused ) {
  14. console.log( 'editor 1', getData( window.editor1.document ) );
  15. }
  16. if ( window.editor2.editing.view.isFocused ) {
  17. console.log( 'editor 2', getData( window.editor2.document ) );
  18. }
  19. }, 3000 );
  20. ClassicEditor.create( document.querySelector( '#editor1' ), config )
  21. .then( editor => {
  22. window.editor1 = editor;
  23. } )
  24. .catch( err => {
  25. console.error( err.stack );
  26. } );
  27. ClassicEditor.create( document.querySelector( '#editor2' ), config )
  28. .then( editor => {
  29. window.editor2 = editor;
  30. } )
  31. .catch( err => {
  32. console.error( err.stack );
  33. } );