image-style-presentational.js 920 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals ClassicEditor, console, window, document */
  6. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';
  7. ClassicEditor
  8. .create( document.querySelector( '#snippet-image-style-custom' ), {
  9. removePlugins: [ 'ImageResize', 'LinkImage' ],
  10. image: {
  11. styles: [
  12. 'alignLeft',
  13. 'alignCenter',
  14. 'alignRight'
  15. ],
  16. toolbar: [
  17. 'imageStyle:alignLeft',
  18. 'imageStyle:alignCenter',
  19. 'imageStyle:alignRight',
  20. '|',
  21. 'imageTextAlternative'
  22. ]
  23. },
  24. toolbar: {
  25. viewportTopOffset: window.getViewportTopOffsetConfig()
  26. },
  27. cloudServices: CS_CONFIG
  28. } )
  29. .then( editor => {
  30. window.editorStyleCustom = editor;
  31. } )
  32. .catch( err => {
  33. console.error( err );
  34. } );