8
0

classiccreatorbundle.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. /**
  7. * Bundle configuration for {@link ckeditor5.creator-classic.ClassiCcreator}.
  8. *
  9. * At this moment we don't know a list of every dependency needed in the bundle. It is because
  10. * editor features load automatically during initialization process. To work around this problem
  11. * we have created a custom entry file where we defined some of imports with features
  12. * needed to initialize editor.
  13. */
  14. import 'babel-runtime/regenerator'; // For test
  15. import CKEDITOR from '../../../build/esnext/ckeditor.js';
  16. import ClassicCreator from '../../../build/esnext/ckeditor5/creator-classic/classiccreator.js';
  17. /**
  18. * Wrapper for {@link CKEDITOR.create} which passes default setting
  19. * for {@link ckeditor5.creator-classic.ClassiCcreator}. This settings could be extended.
  20. * API of this function is exactly the same as {@link CKEDITOR.create}.
  21. */
  22. export default function createEditor( element, config ) {
  23. return CKEDITOR.create( element, Object.assign( {
  24. creator: ClassicCreator,
  25. toolbar: [ 'bold', 'italic' ]
  26. }, config ) );
  27. }