document-editor.js 726 B

123456789101112131415161718192021222324
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console, window, document */
  6. import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document/src/ckeditor';
  7. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  8. DecoupledEditor
  9. .create( document.querySelector( '.document-editor__editable' ), {
  10. cloudServices: CS_CONFIG
  11. } )
  12. .then( editor => {
  13. const toolbarContainer = document.querySelector( '.document-editor__toolbar' );
  14. toolbarContainer.appendChild( editor.ui.view.toolbar.element );
  15. window.editor = editor;
  16. } )
  17. .catch( err => {
  18. console.error( err );
  19. } );