-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
image-resizeui.js
52 lines (49 loc) · 1.13 KB
/
image-resizeui.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
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/* globals ClassicEditor, console, window, document */
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';
ClassicEditor
.create( document.querySelector( '#snippet-image-resizeui' ), {
removePlugins: [ 'LinkImage' ],
toolbar: {
viewportTopOffset: window.getViewportTopOffsetConfig()
},
image: {
resizeOptions: [
{
name: 'imageResize:original',
label: 'Original',
value: null,
icon: 'original'
},
{
name: 'imageResize:50',
label: '50%',
value: '50',
icon: 'medium'
},
{
name: 'imageResize:75',
label: '75%',
value: '75',
icon: 'large'
}
],
toolbar: [
'imageStyle:full',
'imageStyle:side', '|',
'imageResize:50',
'imageResize:75',
'imageResize:original'
]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editorResizeUI = editor;
} )
.catch( err => {
console.error( err );
} );