image-style-custom.js 1006 B

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