8
0

image-style-custom.js 1003 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals ClassicEditor, console, window, document */
  6. import getToken from '@ckeditor/ckeditor5-easy-image/tests/_utils/gettoken';
  7. getToken()
  8. .then( token => {
  9. ClassicEditor
  10. .create( document.querySelector( '#snippet-image-style-custom' ), {
  11. image: {
  12. styles: [
  13. // This option is equal to a situation where no style is applied.
  14. 'imageStyleFull',
  15. // This represents an image aligned to left.
  16. 'imageStyleAlignLeft',
  17. // This represents an image aligned to right.
  18. 'imageStyleAlignRight'
  19. ],
  20. toolbar: [ 'imageTextAlternative', '|', 'imageStyleAlignLeft', 'imageStyleFull', 'imageStyleAlignRight' ]
  21. },
  22. toolbar: {
  23. viewportTopOffset: 60
  24. },
  25. cloudServices: { token }
  26. } )
  27. .then( editor => {
  28. window.editorStyleCustom = editor;
  29. } );
  30. } )
  31. .catch( err => {
  32. console.error( err );
  33. } );