image-style-custom.js 967 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals ClassicEditor, console, window, document */
  6. import { TOKEN_URL } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-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. 'imageStyleFull',
  13. // This represents an image aligned to left.
  14. 'imageStyleAlignLeft',
  15. // This represents an image aligned to right.
  16. 'imageStyleAlignRight'
  17. ],
  18. toolbar: [ 'imageTextAlternative', '|', 'imageStyleAlignLeft', 'imageStyleFull', 'imageStyleAlignRight' ]
  19. },
  20. toolbar: {
  21. viewportTopOffset: 60
  22. },
  23. cloudServices: {
  24. tokenUrl: TOKEN_URL
  25. }
  26. } )
  27. .then( editor => {
  28. window.editorStyleCustom = editor;
  29. } )
  30. .catch( err => {
  31. console.error( err );
  32. } );