image-style-custom.js 825 B

123456789101112131415161718192021222324252627282930313233
  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. ClassicEditor
  7. .create( document.querySelector( '#snippet-image-style-custom' ), {
  8. image: {
  9. styles: [
  10. // This option is equal to a situation where no style is applied.
  11. 'imageStyleFull',
  12. // This represents an image aligned to left.
  13. 'imageStyleAlignLeft',
  14. // This represents an image aligned to right.
  15. 'imageStyleAlignRight'
  16. ],
  17. toolbar: [ 'imageTextAlternative', '|', 'imageStyleAlignLeft', 'imageStyleFull', 'imageStyleAlignRight' ]
  18. },
  19. toolbar: {
  20. viewportTopOffset: 60
  21. }
  22. } )
  23. .then( editor => {
  24. window.editorStyleCustom = editor;
  25. } )
  26. .catch( err => {
  27. console.error( err.stack );
  28. } );