image-style-custom.js 862 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals ClassicEditor, console, window, document */
  6. import './image-style-custom.scss';
  7. ClassicEditor
  8. .create( document.querySelector( '#snippet-image-style-custom' ), {
  9. image: {
  10. styles: [
  11. // This option is equal to a situation where no style is applied.
  12. 'imageStyleFull',
  13. // This represents an image aligned to left.
  14. 'imageStyleAlignLeft',
  15. // This represents an image aligned to right.
  16. 'imageStyleAlignRight'
  17. ],
  18. toolbar: [ 'imageTextAlternative', '|', 'imageStyleAlignLeft', 'imageStyleFull', 'imageStyleAlignRight' ]
  19. },
  20. toolbar: {
  21. viewportTopOffset: 60
  22. }
  23. } )
  24. .then( editor => {
  25. window.editorStyleCustom = editor;
  26. } )
  27. .catch( err => {
  28. console.error( err.stack );
  29. } );