image-resize-buttons-dropdown.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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-resize-buttons-dropdown' ), {
  9. removePlugins: [ 'LinkImage', 'AutoImage' ],
  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'
  42. ]
  43. },
  44. cloudServices: CS_CONFIG
  45. } )
  46. .then( editor => {
  47. window.editorResizeUIDropdown = editor;
  48. } )
  49. .catch( err => {
  50. console.error( err );
  51. } );