Expand all

ve.ui.DataTransferHandlerFactory

Extends

Constructor

new ve.ui.DataTransferHandlerFactory() #

Data transfer handler factory.

Methods

getHandlerNameForItem(item, [isPaste], [isPasteSpecial]) → {string|undefined} #

Get a handler name for a specific data transfer item

Parameters:

Name Type Attributes Default Description
item ve.ui.DataTransferItem

Data transfer item

isPaste boolean optional
false

Handler being used for paste

isPasteSpecial boolean optional
false

Handler being used for "paste special"

Returns:

Handler name, or undefined if not found

Type
string | undefined
Source:
Get a handler name for a specific data transfer item

register(constructor, [name]) #

Register a constructor with the factory.

function MyClass() {};
OO.initClass( MyClass );
MyClass.static.name = 'hello';
// Register class with the factory, available via the symbolic name "hello"
factory.register( MyClass );

See https://doc.wikimedia.org/oojs/master/OO.Factory.html

Parameters:

Name Type Attributes Description
constructor function

Constructor to use when creating object

name string optional

Symbolic name to use for #create(). This parameter may be omitted in favour of letting the constructor decide its own name, through constructor.static.name.

Throws:

If a parameter is invalid

Type
Error
Source:
Register a constructor with the factory.

unregister(constructor) #

Unregister a constructor from the factory.

See https://doc.wikimedia.org/oojs/master/OO.Factory.html

Parameters:

Name Type Description
constructor string | function

Constructor function or symbolic name to unregister

Throws:

If a parameter is invalid

Type
Error
Source:
Unregister a constructor from the factory.

updateIndexes(constructor, [insert]) #

Update indexes used for handler lookup

Parameters:

Name Type Attributes Default Description
constructor function

Handler's constructor to insert/remove

insert boolean optional
false

Insert the handler into the indexes, remove otherwise

Source:
Update indexes used for handler lookup