2015-03-27 19:05:26 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MWAlienExtensionContextItem class.
|
|
|
|
*
|
2017-01-03 16:58:33 +00:00
|
|
|
* @copyright 2011-2017 VisualEditor Team and others; see http://ve.mit-license.org
|
2015-03-27 19:05:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Context item for a MWAlienExtension.
|
|
|
|
*
|
|
|
|
* @class
|
2015-08-18 15:55:13 +00:00
|
|
|
* @extends ve.ui.LinearContextItem
|
2015-03-27 19:05:26 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {ve.ui.Context} context Context item is in
|
|
|
|
* @param {ve.dm.Model} model Model item is related to
|
|
|
|
* @param {Object} config Configuration options
|
|
|
|
*/
|
2015-08-18 12:54:51 +00:00
|
|
|
ve.ui.MWAlienExtensionContextItem = function VeUiMWAlienExtensionContextItem( context, model ) {
|
2015-03-27 19:05:26 +00:00
|
|
|
// Parent constructor
|
|
|
|
ve.ui.MWAlienExtensionContextItem.super.apply( this, arguments );
|
|
|
|
|
|
|
|
// Initialization
|
|
|
|
this.$element.addClass( 've-ui-mwAlienExtensionContextItem' );
|
|
|
|
|
|
|
|
this.setLabel( model.getExtensionName() );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2015-08-18 15:55:13 +00:00
|
|
|
OO.inheritClass( ve.ui.MWAlienExtensionContextItem, ve.ui.LinearContextItem );
|
2015-03-27 19:05:26 +00:00
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.ui.MWAlienExtensionContextItem.static.name = 'alienExtension';
|
|
|
|
|
|
|
|
ve.ui.MWAlienExtensionContextItem.static.icon = 'alienextension';
|
|
|
|
|
2015-03-23 15:49:38 +00:00
|
|
|
ve.ui.MWAlienExtensionContextItem.static.modelClasses = [
|
|
|
|
ve.dm.MWAlienInlineExtensionNode,
|
|
|
|
ve.dm.MWAlienBlockExtensionNode
|
|
|
|
];
|
2015-03-27 19:05:26 +00:00
|
|
|
|
|
|
|
ve.ui.MWAlienExtensionContextItem.static.commandName = 'alienExtension';
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ui.contextItemFactory.register( ve.ui.MWAlienExtensionContextItem );
|
2015-08-02 11:24:15 +00:00
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'alienExtension', 'window', 'open',
|
|
|
|
{ args: [ 'alienExtension' ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|