Expand all

ve.ui.UrlStringTransferHandler

Extends

Constructor

new ve.ui.UrlStringTransferHandler(surface, item) #

Handle pastes and drag-and-drop of URLs and links. Attempts to preserve link titles when possible.

Parameters:

Name Type Description
surface ve.ui.Surface
item ve.ui.DataTransferItem
Source:
Handle pastes and drag-and-drop of URLs and links.

Properties

urlRegExpprivatestatic #

RegExp matching an external url.

Properties:

Type Description
RegExp
Source:
RegExp matching an external url.

Methods

abort() #

Abort the data transfer handler

Inherited from:
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

Inherited from:
Source:
Create a progress bar with a specified label

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

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.