8
0

image-resizeui.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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-resizeui' ), {
  9. removePlugins: [ 'LinkImage' ],
  10. toolbar: {
  11. viewportTopOffset: window.getViewportTopOffsetConfig()
  12. },
  13. image: {
  14. resizeOptions: [
  15. {
  16. name: 'imageResize:original',
  17. label: 'Original',
  18. value: null
  19. },
  20. {
  21. name: 'imageResize:50',
  22. label: '50%',
  23. value: '50'
  24. },
  25. {
  26. name: 'imageResize:75',
  27. label: '75%',
  28. value: '75'
  29. }
  30. ],
  31. styles: [
  32. 'alignLeft',
  33. 'alignCenter',
  34. 'alignRight'
  35. ],
  36. toolbar: [
  37. 'imageStyle:alignLeft',
  38. 'imageStyle:alignCenter',
  39. 'imageStyle:alignRight',
  40. '|',
  41. 'imageResize:50',
  42. 'imageResize:75',
  43. 'imageResize:original'
  44. ]
  45. },
  46. cloudServices: CS_CONFIG
  47. } )
  48. .then( editor => {
  49. window.editorResizeUI = editor;
  50. } )
  51. .catch( err => {
  52. console.error( err );
  53. } );