image-style-custom.js 1.0 KB

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. // This option is equal to a situation where no style is applied.
  13. 'full',
  14. // This represents an image aligned to left.
  15. 'alignLeft',
  16. // This represents an image aligned to right.
  17. 'alignRight'
  18. ],
  19. toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ]
  20. },
  21. toolbar: {
  22. viewportTopOffset: window.getViewportTopOffsetConfig()
  23. },
  24. cloudServices: CS_CONFIG
  25. } )
  26. .then( editor => {
  27. window.editorStyleCustom = editor;
  28. } )
  29. .catch( err => {
  30. console.error( err );
  31. } );