-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathclassic-editor.js
More file actions
38 lines (35 loc) · 883 Bytes
/
classic-editor.js
File metadata and controls
38 lines (35 loc) · 883 Bytes
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
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
import {
CS_CONFIG,
ClassicEditor,
getViewportTopOffsetConfig,
setViewportTopOffsetDynamically
} from '@snippets/index.js';
ClassicEditor
.create( document.querySelector( '#snippet-classic-editor' ), {
cloudServices: CS_CONFIG,
toolbar: {
items: [
'undo', 'redo',
'|', 'heading',
'|', 'bold', 'italic',
'|', 'link', 'bookmark', 'insertImage', 'insertTable', 'mediaEmbed',
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
ui: {
viewportOffset: {
top: getViewportTopOffsetConfig()
}
}
} )
.then( editor => {
window.editor = editor;
setViewportTopOffsetDynamically( editor );
} )
.catch( err => {
console.error( err );
} );