Adapter (ckbox)
@ckeditor/ckeditor5-ckbox/src/ckboxuploadadapter
Upload adapter for CKBox.
Filtering
Properties
-
assetsOrigin : Stringmodule:ckbox/ckboxuploadadapter~Adapter#assetsOriginThe base URL from where all assets are served.
-
controller : AbortControllermodule:ckbox/ckboxuploadadapter~Adapter#controllerThe abort controller for aborting asynchronous processes.
-
The editor instance.
-
loader : FileLoadermodule:ckbox/ckboxuploadadapter~Adapter#loaderFileLoader instance to use during the upload.
-
serviceOrigin : Stringmodule:ckbox/ckboxuploadadapter~Adapter#serviceOriginThe 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#getAvailableCategoriesResolves 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#getCategoryIdForFileResolves 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 ] ) → Promisemodule:ckbox/ckboxuploadadapter~Adapter#_sendHttpRequestSends the HTTP request.
Parameters
config.url : URLthe URL where the request will be sent.
[ config.method ] : 'GET' | 'POST'The HTTP method.
Defaults to
'GET'[ config.data ] : FormData | nullAdditional data to send.
[ config.onUploadProgress ] : functionA 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.