Expand all

abstract ve.ui.FileTransferHandler

Extends

Constructor

new ve.ui.FileTransferHandler(surface, item)abstract #

Data transfer handler.

Properties

extensionsstatic #

List of file extensions supported by this handler

This is used as a fallback if no types were matched.

Properties:

Type Description
Array.<string>
Source:

List of file extensions supported by this handler

This is used as a fallback if no types were matched.

Methods

abort() #

Abort the data transfer handler

Overrides:
Source:
Abort the data transfer handler

createProgress(progressCompletePromise, [label]) #

Overrides the parent to make the default label the filename

Parameters:

Name Type Attributes Description
progressCompletePromise jQuery.Promise
label jQuery | string | function optional

Progress bar label, defaults to file name

Overrides:
Source:
Overrides the parent to make the default label the filename

getInsertableData() → {jQuery.Promise} #

Insert the file at a specified fragment

Inherited from:
Source:

Returns:

Promise which resolves with data to insert

Type
jQuery.Promise
Insert the file at a specified fragment

onFileError(e) #

Handle error events from the file reader

Parameters:

Name Type Description
e Event

Error event

Source:
Handle error events from the file reader

onFileLoad(e) #

Handle load events from the file reader

Parameters:

Name Type Description
e Event

Load event

Source:
Handle load events from the file reader

onFileProgress(e) #

Handle progress events from the file reader

Parameters:

Name Type Description
e Event

Progress event

Source:
Handle progress events from the file reader

process() #

Process the file

Implementations should aim to resolve this.insertableDataDeferred.

Overrides:
Source:

Process the file

Implementations should aim to resolve this.insertableDataDeferred.

resolve(dataOrDoc) #

Resolve the data transfer handler with some data

Parameters:

Name Type Description
dataOrDoc ve.dm.Document | string | Array

Insertable data or document

Inherited from:
Source:
Resolve the data transfer handler with some data

setProgress(progress) #

Set progress bar progress

Progress is stored in a property in case the progress bar doesn't exist yet.

Parameters:

Name Type Description
progress number

Progress percent

Inherited from:
Source:

Set progress bar progress

Progress is stored in a property in case the progress bar doesn't exist yet.