image-resizeui.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. icon: 'original'
  20. },
  21. {
  22. name: 'imageResize:50',
  23. label: '50%',
  24. value: '50',
  25. icon: 'medium'
  26. },
  27. {
  28. name: 'imageResize:75',
  29. label: '75%',
  30. value: '75',
  31. icon: 'large'
  32. }
  33. ],
  34. toolbar: [
  35. 'imageStyle:full',
  36. 'imageStyle:side', '|',
  37. 'imageResize:50',
  38. 'imageResize:75',
  39. 'imageResize:original'
  40. ]
  41. },
  42. cloudServices: CS_CONFIG
  43. } )
  44. .then( editor => {
  45. window.editorResizeUI = editor;
  46. } )
  47. .catch( err => {
  48. console.error( err );
  49. } );