-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
imageresize.js
67 lines (60 loc) · 1.88 KB
/
imageresize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* global document, console, window */
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import ImageResize from '../../src/imageresize';
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
const commonConfig = {
plugins: [
ArticlePluginSet,
ImageResize,
Indent,
IndentBlock,
EasyImage
],
toolbar: [ 'heading', '|', 'bold', 'italic', 'link',
'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'undo', 'redo', 'outdent', 'indent' ],
image: {
toolbar: [ 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight', '|', 'imageResize' ],
styles: [
'alignLeft',
'alignCenter',
'alignRight'
]
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ],
tableToolbar: [ 'bold', 'italic' ]
},
cloudServices: CS_CONFIG
};
ClassicEditor
.create( document.querySelector( '#editor' ), commonConfig )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
ClassicEditor
.create( document.querySelector( '#fancy-editor' ), commonConfig )
.then( editor => {
window.fancyEditor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
ClassicEditor
.create( document.querySelector( '#editor-other-units' ), commonConfig )
.then( editor => {
window.editorOtherUnits = editor;
} )
.catch( err => {
console.error( err.stack );
} );