image-resizeui.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 size',
  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. toolbar: [
  32. 'imageStyle:full',
  33. 'imageStyle:side', '|',
  34. 'imageResize:original',
  35. 'imageResize:50',
  36. 'imageResize:75'
  37. ]
  38. },
  39. cloudServices: CS_CONFIG
  40. } )
  41. .then( editor => {
  42. window.editorResizeUI = editor;
  43. } )
  44. .catch( err => {
  45. console.error( err );
  46. } );