Methods

This function creates an upload widget — a placeholder to show the progress of an upload. The upload widget
is based on its definition. The addUploadWidget method also
creates a paste event, if the fileToElement method
is defined. This event helps in handling pasted files, as it will automatically check if the files were pasted and
mark them to be uploaded.

To create an upload widget you need to define two transformation methods:

The fileToElement method which will be called on
paste and transform a file into a placeholder.

The onUploaded method with
the replaceWith method which will be called to replace
the upload placeholder with the final HTML when the upload is done.
If you want to show more information about the progress you can also define
the onLoading and
onUploading methods.

The simplest uploading widget which uploads a file and creates a link to it may look like this:

If you need custom paste handling, you need to mark the pasted element to be changed into an upload widget
using markElement. For example, instead of the fileToElement helper from the
example above, a paste listener can be created manually:

Note that you can bind notifications to the upload widget on paste using
the bindNotifications method, so notifications will automatically
show the progress of the upload. Because this method shows notifications about upload, do not use it if you only
load (and not upload) a file.

Binds a notification to the file loader so the upload widget will use
the notification to show the status and progress.
This function uses CKEDITOR.plugins.notificationAggregator, so even if multiple files are uploading
only one notification is shown. Warnings are an exception, because they are shown in separate notifications.
This notification shows only the progress of the upload, so this method should not be used if
the loader.load method was called. It works with
upload and loadAndUpload.