-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
image-resizeuidropdown.js
54 lines (51 loc) · 1.15 KB
/
image-resizeuidropdown.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
/**
* @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-dropdown' ), {
removePlugins: [ 'LinkImage' ],
toolbar: {
viewportTopOffset: window.getViewportTopOffsetConfig()
},
image: {
resizeOptions: [
{
name: 'imageResize:original',
label: 'Original',
value: null
},
{
name: 'imageResize:50',
label: '50%',
value: '50'
},
{
name: 'imageResize:75',
label: '75%',
value: '75'
}
],
styles: [
'alignLeft',
'alignCenter',
'alignRight'
],
toolbar: [
'imageStyle:alignLeft',
'imageStyle:alignCenter',
'imageStyle:alignRight',
'|',
'imageResize'
]
},
cloudServices: CS_CONFIG
} )
.then( editor => {
window.editorResizeUIDropdown = editor;
} )
.catch( err => {
console.error( err );
} );