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