image-style-custom.js 819 B

1234567891011121314151617181920212223242526272829303132
  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. } )
  21. .then( editor => {
  22. window.editorStyleCustom = editor;
  23. } )
  24. .catch( err => {
  25. console.error( err.stack );
  26. } );