Page MenuHomeWickedGov Phorge

ext.uls.actions.menu.items.registry.js
No OneTemporary

Size
998 B
Referenced Files
None
Subscribers
None

ext.uls.actions.menu.items.registry.js

( function () {
'use strict';
function ActionsMenuItemsRegistry() {
ActionsMenuItemsRegistry.super.apply( this, arguments );
}
OO.inheritClass( ActionsMenuItemsRegistry, OO.Registry );
ActionsMenuItemsRegistry.prototype.size = function () {
return Object.keys( this.registry ).length;
};
ActionsMenuItemsRegistry.prototype.getItems = function () {
const registry = this.registry;
return Object.keys( registry ).map( ( key ) => registry[ key ] );
};
/**
* Register an action item with the factory.
* Actions items are required to include all necessary properties,
* i.e. name, icon, text and handler function.
*
* @param {{name: string, icon: string, text: string, handler: Function}} item
*/
ActionsMenuItemsRegistry.prototype.register = function ( item ) {
// Parent method
ActionsMenuItemsRegistry.super.prototype.register.call( this, item.name, item );
};
mw.uls = mw.uls || {};
mw.uls.ActionsMenuItemsRegistry = new ActionsMenuItemsRegistry();
}() );

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 23, 22:02 (6 d, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f1/6a/ad3a8d62ecfb6f3765c9d026d3c9
Default Alt Text
ext.uls.actions.menu.items.registry.js (998 B)

Event Timeline