imagestyle.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. /* 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. ClassicEditor
  9. .create( document.querySelector( '#editor-semantic' ), {
  10. plugins: [
  11. ArticlePluginSet
  12. ],
  13. toolbar: [
  14. 'heading',
  15. '|',
  16. 'bold',
  17. 'italic',
  18. 'link',
  19. 'bulletedList',
  20. 'numberedList',
  21. 'blockQuote',
  22. 'insertTable',
  23. 'mediaEmbed',
  24. 'undo',
  25. 'redo'
  26. ],
  27. image: {
  28. toolbar: [ 'imageStyle:full', 'imageStyle:side' ]
  29. }
  30. } )
  31. .then( editor => {
  32. window.editorSemantic = editor;
  33. } )
  34. .catch( err => {
  35. console.error( err.stack );
  36. } );
  37. ClassicEditor
  38. .create( document.querySelector( '#editor-formatting' ), {
  39. plugins: [
  40. ArticlePluginSet
  41. ],
  42. toolbar: [
  43. 'heading',
  44. '|',
  45. 'bold',
  46. 'italic',
  47. 'link',
  48. 'bulletedList',
  49. 'numberedList',
  50. 'blockQuote',
  51. 'insertTable',
  52. 'mediaEmbed',
  53. 'undo',
  54. 'redo'
  55. ],
  56. image: {
  57. styles: [ 'alignLeft', 'alignCenter', 'alignRight' ],
  58. toolbar: [ 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight' ]
  59. }
  60. } )
  61. .then( editor => {
  62. window.editorFormatting = editor;
  63. } )
  64. .catch( err => {
  65. console.error( err.stack );
  66. } );