2015-03-27 19:05:26 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MWAlienExtensionContextItem class.
|
|
|
|
*
|
2020-01-08 17:13:04 +00:00
|
|
|
* @copyright 2011-2020 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';
|
|
|
|
|
2018-03-20 17:26:35 +00:00
|
|
|
ve.ui.MWAlienExtensionContextItem.static.icon = 'markup';
|
2015-03-27 19:05:26 +00:00
|
|
|
|
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' ] }
|
|
|
|
)
|
|
|
|
);
|