Expand all

abstract ve.ui.DataTransferHandler

Constructor

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

Parameters:

Name Type Description
surface ve.ui.Surface
item ve.ui.DataTransferItem

Data transfer item to handle

Source:
Data transfer handler.

Properties

handlesPaste :booleanstatic #

Use handler when data transfer source is a paste

Type:

  • boolean
Source:
Use handler when data transfer source is a paste

handlesPasteSpecial :booleanstatic #

Use handler when data transfer source is a "paste special"

Type:

  • boolean
Source:
Use handler when data transfer source is a "paste special"

kindsstatic #

List of transfer kinds supported by this handler

Null means all kinds are supported.

Properties:

Type Description
Array.<string> | null
Source:

List of transfer kinds supported by this handler

Null means all kinds are supported.

matchFunction :functionstatic #

Custom match function which is given the data transfer item as its only argument and returns a boolean indicating if the handler matches

Null means the handler always matches

Type:

  • function
Source:

Custom match function which is given the data transfer item as its only argument and returns a boolean indicating if the handler matches

Null means the handler always matches

namestatic #

Symbolic name for this handler. Must be unique.

Properties:

Type Description
string
Source:
Symbolic name for this handler.

typesstatic #

List of mime types supported by this handler

Properties:

Type Description
Array.<string>
Source:
List of mime types supported by this handler

Methods

abort() #

Abort the data transfer handler

Source:
Abort the data transfer handler

createProgress(progressCompletePromise, label) #

Create a progress bar with a specified label

Parameters:

Name Type Description
progressCompletePromise jQuery.Promise

Promise which resolves when the progress action is complete

label jQuery | string | function

Progress bar label

Source:
Create a progress bar with a specified label

getInsertableData() → {jQuery.Promise} #

Insert the file at a specified fragment

Source:

Returns:

Promise which resolves with data to insert

Type
jQuery.Promise
Insert the file at a specified fragment

process()abstract #

Process the file

Implementations should aim to resolve this.insertableDataDeferred.

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

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

Source:

Set progress bar progress

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