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 : FunctionCKEDITOR.plugins.imagebase.featuresDefinitions.upload#loaderTypeprogressReporterType : Function | BooleanCKEDITOR.plugins.imagebase.featuresDefinitions.upload#progressReporterTypeThe type used for progress reporting. It has to be a subclass of CKEDITOR.plugins.imagebase.progressReporter.
It can be set to
falseso 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#_beginUploadInitializes the upload process for a given
widgetusingloader.Parameters
widget : widgetloader : fileLoader
private
_insertWidget( editor, widgetDef, blobUrl, [ finalize ] ) → widget | elementCKEDITOR.plugins.imagebase.featuresDefinitions.upload#_insertWidgetParameters
editor : editorwidgetDef : definitionblobUrl : StringBlob URL of an image.
[ finalize ] : BooleanIf
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 | elementThe widget instance or CKEDITOR.dom.element of a widget wrapper if
finalizewas set tofalse.
private
_isLoaderDone( loader ) → BooleanCKEDITOR.plugins.imagebase.featuresDefinitions.upload#_isLoaderDoneprivate
_spawnLoader( editor, file, widgetDef, [ fileName ] ) → fileLoaderCKEDITOR.plugins.imagebase.featuresDefinitions.upload#_spawnLoaderParameters
editor : editorfile : Blob | StringwidgetDef : definitionThe widget definition that the loader is spawned for.
[ fileName ] : StringPreferred file name to be passed to the upload process.
Returns
fileLoader
Events
uploadDone( evt )CKEDITOR.plugins.imagebase.featuresDefinitions.upload#uploadDoneFired 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#uploadFaileduploadStarted( evt )CKEDITOR.plugins.imagebase.featuresDefinitions.upload#uploadStartedFired 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_uploadingclass.Note that the event will be fired even if the widget was created for a loader that is already resolved.
Parameters
evt : eventInfo