Adapter (ckbox)
@ckeditor/ckeditor5-ckbox/src/ckboxuploadadapter
Upload adapter for CKBox.
Filtering
Properties
-
assetsOrigin : String
module:ckbox/ckboxuploadadapter~Adapter#assetsOrigin
The base URL from where all assets are served.
-
controller : AbortController
module:ckbox/ckboxuploadadapter~Adapter#controller
The abort controller for aborting asynchronous processes.
-
The editor instance.
-
loader : FileLoader
module:ckbox/ckboxuploadadapter~Adapter#loader
FileLoader instance to use during the upload.
-
serviceOrigin : String
module:ckbox/ckboxuploadadapter~Adapter#serviceOrigin
The base URL where all requests should be sent.
-
CKEditor Cloud Services access token.
Methods
-
constructor( loader, token, editor )
module:ckbox/ckboxuploadadapter~Adapter#constructor
-
abort()
module:ckbox/ckboxuploadadapter~Adapter#abort
-
getAvailableCategories( [ offset ] ) → Promise.<Array>
module:ckbox/ckboxuploadadapter~Adapter#getAvailableCategories
Resolves a promise with an array containing available categories with which the uploaded file can be associated.
If the API returns limited results, the method will collect all items.
Parameters
[ offset ] : Number
-
Defaults to
0
Returns
Promise.<Array>
-
getCategoryIdForFile( file ) → Promise.<(String | null)>
module:ckbox/ckboxuploadadapter~Adapter#getCategoryIdForFile
Resolves a promise with an object containing a category with which the uploaded file is associated or an error code.
Parameters
file : File
Returns
Promise.<(String | null)>
-
upload() → Promise.<Object>
module:ckbox/ckboxuploadadapter~Adapter#upload
-
Resolves a promise with a number representing the width of a given image file.
Returns
Promise.<Number>
-
protected
_sendHttpRequest( config.url, [ config.method ], [ config.data ], [ config.onUploadProgress ] ) → Promise
module:ckbox/ckboxuploadadapter~Adapter#_sendHttpRequest
Sends the HTTP request.
Parameters
config.url : URL
the URL where the request will be sent.
[ config.method ] : 'GET' | 'POST'
The HTTP method.
Defaults to
'GET'
[ config.data ] : FormData | null
Additional data to send.
[ config.onUploadProgress ] : function
A callback informing about the upload progress.
Returns
Promise
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.