This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
ckfinder.js
118 lines (108 loc) · 3.44 KB
/
ckfinder.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
/**
* @module ckfinder/ckfinder
*/
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import CKFinderUI from './ckfinderui';
import CKFinderEditing from './ckfinderediting';
import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter';
/**
* The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
* [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
*
* This is a "glue" plugin which enables:
*
* * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
* * {@link module:ckfinder/ckfinderui~CKFinderUI},
* * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
*
* See the {@glink features/image-upload/ckfinder "CKFinder integration" guide} to learn how to configure
* and use this feature.
*
* Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
* other ways to upload images into CKEditor 5.
*
* @extends module:core/plugin~Plugin
*/
export default class CKFinder extends Plugin {
/**
* @inheritDoc
*/
static get pluginName() {
return 'CKFinder';
}
/**
* @inheritDoc
*/
static get requires() {
return [ CKFinderEditing, CKFinderUI, CKFinderUploadAdapter ];
}
}
/**
* The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
*
* Read more in {@link module:ckfinder/ckfinder~CKFinderConfig}.
*
* @member {module:ckfinder/ckfinder~CKFinderConfig} module:core/editor/editorconfig~EditorConfig#ckfinder
*/
/**
* The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
* and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
*
* ClassicEditor
* .create( editorElement, {
* ckfinder: {
* options: {
* resourceType: 'Images'
* }
* }
* } )
* .then( ... )
* .catch( ... );
*
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
*
* @interface CKFinderConfig
*/
/**
* The configuration options passed to the CKFinder file manager instance.
*
* Check the file manager {@glink @ckfinder ckfinder3/#!/api/CKFinder.Config documentation} for the complete list of options.
*
* @member {Object} module:ckfinder/ckfinder~CKFinderConfig#options
*/
/**
* The type of the CKFinder opener method.
*
* Supported types are:
*
* * `'modal'` - opens a CKFinder in a modal,
* * `'popup'` - opens a CKFinder in a new "pop-up" window.
*
* Defaults to `'modal'`.
*
* @member {String} module:ckfinder/ckfinder~CKFinderConfig#openerMethod
*/
/**
* The path (URL) to the connector which handles the file upload in the CKFinder file manager.
* When specified, enables the automatic upload of resources such as images inserted into the content.
*
* For instance, to use CKFinder's {@glink @ckfinder ckfinder3-php/commands.html#command_quick_upload quick upload}
* command, your can use the following (or similar) path:
*
* ClassicEditor
* .create( editorElement, {
* ckfinder: {
* uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
* }
* } )
* .then( ... )
* .catch( ... );
*
* Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
*
* @member {String} module:ckfinder/ckfinder~CKFinderConfig#uploadUrl
*/