CKEDITOR.plugins.imagebase.featuresDefinitions.upload
Widget feature dedicated to handling seamless file uploads.
This type serves solely as a mixin, and should be added using the CKEDITOR.plugins.imagebase.addFeature method.
This API is not yet in a final shape, thus it is marked as private. It can change at any point in the future.
Filtering
Properties
-
loaderType : Function
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#loaderType
-
progressReporterType : Function | Boolean
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#progressReporterType
The type used for progress reporting. It has to be a subclass of CKEDITOR.plugins.imagebase.progressReporter.
It can be set to
false
so that there is no progress reporter created at all.Defaults to
CKEDITOR.plugins.imagebase.progressBar
Methods
-
private
_beginUpload( widget, loader )
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#_beginUpload
Initializes the upload process for a given
widget
usingloader
.Parameters
widget : widget
loader : fileLoader
-
private
_insertWidget( editor, widgetDef, blobUrl, [ finalize ] ) → widget | element
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#_insertWidget
Parameters
editor : editor
widgetDef : definition
blobUrl : String
Blob URL of an image.
[ finalize ] : Boolean
If
false
, the widget will not be automatically finalized (added to CKEDITOR.plugins.widget.repository), but will be returned as a CKEDITOR.dom.element instance.Defaults to
true
Returns
widget | element
The widget instance or CKEDITOR.dom.element of a widget wrapper if
finalize
was set tofalse
.
-
private
_isLoaderDone( loader ) → Boolean
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#_isLoaderDone
-
private
_spawnLoader( editor, file, widgetDef, [ fileName ] ) → fileLoader
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#_spawnLoader
Parameters
editor : editor
file : Blob | String
widgetDef : definition
The widget definition that the loader is spawned for.
[ fileName ] : String
Preferred file name to be passed to the upload process.
Returns
fileLoader
Events
-
uploadDone( evt )
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#uploadDone
Fired when the upload process succeeded. This is the event where you want apply the data from your response into a widget.
progress.once( 'uploadDone', function( evt ) { var response = evt.data.loader.responseData.response; this.setData( 'backendUrl', response.url ); } );
Parameters
evt : eventInfo
-
uploadFailed( evt )
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#uploadFailed
-
uploadStarted( evt )
CKEDITOR.plugins.imagebase.featuresDefinitions.upload#uploadStarted
Fired when upload was initiated and before the response is fetched.
progress.once( 'uploadStarted', function( evt ) { evt.cancel(); // Implement a custom progress bar. } );
This event is cancelable. If canceled, the default progress bar will not be created and the widget wrapper will not be marked with the
cke_widget_wrapper_uploading
class.Note that the event will be fired even if the widget was created for a loader that is already resolved.
Parameters
evt : eventInfo