mediawiki-extensions-Visual.../modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js
Ed Sanders 17f0fffe85 Update VE core submodule to master (1191940)
New changes:
de69c36 Fix typos in function names
fa80099 [BREAKING CHANGE] Split out linear context from context
db1d28c Only show alien context for focusable nodes
1191940 build: Bump grunt-jscs to 2.0.0 and make pass

Local changes:
* Update context inheritance

Change-Id: I284e2b30cd1903770482ee1c554687b676a2d626
2015-08-18 11:24:08 -07:00

57 lines
1.4 KiB
JavaScript

/*!
* VisualEditor MWAlienExtensionContextItem class.
*
* @copyright 2011-2015 VisualEditor Team and others; see http://ve.mit-license.org
*/
/**
* Context item for a MWAlienExtension.
*
* @class
* @extends ve.ui.LinearContextItem
*
* @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
*/
ve.ui.MWAlienExtensionContextItem = function VeUiMWAlienExtensionContextItem( context, model ) {
// Parent constructor
ve.ui.MWAlienExtensionContextItem.super.apply( this, arguments );
// Initialization
this.$element.addClass( 've-ui-mwAlienExtensionContextItem' );
this.setLabel( model.getExtensionName() );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWAlienExtensionContextItem, ve.ui.LinearContextItem );
/* Static Properties */
ve.ui.MWAlienExtensionContextItem.static.name = 'alienExtension';
ve.ui.MWAlienExtensionContextItem.static.icon = 'alienextension';
ve.ui.MWAlienExtensionContextItem.static.modelClasses = [
ve.dm.MWAlienInlineExtensionNode,
ve.dm.MWAlienBlockExtensionNode
];
ve.ui.MWAlienExtensionContextItem.static.commandName = 'alienExtension';
/* Methods */
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWAlienExtensionContextItem );
ve.ui.commandRegistry.register(
new ve.ui.Command(
'alienExtension', 'window', 'open',
{ args: [ 'alienExtension' ], supportedSelections: [ 'linear' ] }
)
);