Constructor
new ve.ui.DataTransferHandler(surface, item)abstract
#
Children
Data transfer handler.
Parameters:
Name | Type | Description |
---|---|---|
surface |
ve.ui.Surface | |
item |
ve.ui.DataTransferItem | Data transfer item to handle |
Properties
handlesPaste :booleanstatic
#
Use handler when data transfer source is a paste
Type:
- boolean
handlesPasteSpecial :booleanstatic
#
Use handler when data transfer source is a "paste special"
Type:
- boolean
kindsstatic
#
List of transfer kinds supported by this handler
Null means all kinds are supported.
Properties:
Type | Description |
---|---|
Array.<string>
|
null
|
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
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 |
typesstatic
#
Methods
abort()
#
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 |
getInsertableData() → {jQuery.Promise}
#
Insert the file at a specified fragment
Returns:
Promise which resolves with data to insert
- Type
- jQuery.Promise
process()abstract
#
Process the file
Implementations should aim to resolve this.insertableDataDeferred.
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 |
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 |
Set progress bar progress
Progress is stored in a property in case the progress bar doesn't exist yet.