imageresize.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* global document, console, window */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  8. import ImageResize from '../../src/imageresize';
  9. import Indent from '@ckeditor/ckeditor5-indent/src/indent';
  10. import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
  11. import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
  12. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  13. const commonConfig = {
  14. plugins: [
  15. ArticlePluginSet,
  16. ImageResize,
  17. Indent,
  18. IndentBlock,
  19. EasyImage
  20. ],
  21. toolbar: [ 'heading', '|', 'bold', 'italic', 'link',
  22. 'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'undo', 'redo', 'outdent', 'indent' ],
  23. image: {
  24. toolbar: [ 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:side' ],
  25. styles: [
  26. 'full',
  27. 'alignLeft',
  28. 'side' // Purposely using side image instead right aligned image to make sure it works well with both style types.
  29. ]
  30. },
  31. cloudServices: CS_CONFIG
  32. };
  33. ClassicEditor
  34. .create( document.querySelector( '#editor' ), commonConfig )
  35. .then( editor => {
  36. window.editor = editor;
  37. } )
  38. .catch( err => {
  39. console.error( err.stack );
  40. } );
  41. ClassicEditor
  42. .create( document.querySelector( '#fancyEditor' ), commonConfig )
  43. .then( editor => {
  44. window.fancyEditor = editor;
  45. } )
  46. .catch( err => {
  47. console.error( err.stack );
  48. } );