virtualeditingcontroller.js 835 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. import ModelConversionDispatcher from '/ckeditor5/engine/conversion/modelconversiondispatcher.js';
  7. import ViewDocument from '/ckeditor5/engine/view/document.js';
  8. /**
  9. * A simplified {@link engine.EditingController editing controller} which should be enough
  10. * to test engine part of features.
  11. *
  12. * Should work in Node.js. If not now, then in the future :).
  13. *
  14. * @memberOf tests.ckeditor5._utils
  15. */
  16. export default class VirtualEditingController {
  17. constructor( model ) {
  18. this.model = model;
  19. this.view = new ViewDocument();
  20. this.modelToView = new ModelConversionDispatcher( {
  21. writer: this.view.writer,
  22. mapper: this.mapper,
  23. viewSelection: this.view.selection
  24. } );
  25. }
  26. }