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 Description
item ve.ui.DataTransferItem

Data transfer item

isPaste boolean

Handler being used for paste

isPasteSpecial boolean

Handler being used for "paste special"

Source:

Returns:

Handler name, or undefined if not found

Type
string | undefined
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.

Source:

Throws:

If a parameter is invalid

Type
Error
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

Source:

Throws:

If a parameter is invalid

Type
Error
Unregister a constructor from the factory.

updateIndexes(constructor, insert) #

Update indexes used for handler loopup

Parameters:

Name Type Description
constructor function

Handler's constructor to insert/remove

insert boolean

Insert the handler into the indexes, remove otherwise

Source:
Update indexes used for handler loopup