mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
Merge "Simplify context item for MWAlienExtensionNodes"
This commit is contained in:
commit
1b3a655ac6
|
@ -1500,7 +1500,7 @@ $wgResourceModules += array(
|
|||
'modules/ve-mw/dm/nodes/ve.dm.MWAlienExtensionNode.js',
|
||||
'modules/ve-mw/ce/nodes/ve.ce.MWAlienExtensionNode.js',
|
||||
'modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js',
|
||||
'modules/ve-mw/ui/tools/ve.ui.MWAlienExtensionInspectorTool.js',
|
||||
'modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js',
|
||||
),
|
||||
'styles' => array(
|
||||
'modules/ve-mw/ui/styles/inspectors/ve.ui.MWAlienExtensionInspector.css',
|
||||
|
@ -1508,9 +1508,6 @@ $wgResourceModules += array(
|
|||
'dependencies' => array(
|
||||
'ext.visualEditor.mwcore',
|
||||
),
|
||||
'messages' => array(
|
||||
'visualeditor-mwalienextensioninspector-title',
|
||||
),
|
||||
'targets' => array( 'desktop', 'mobile' ),
|
||||
),
|
||||
|
||||
|
|
|
@ -1523,7 +1523,7 @@
|
|||
"modules/ve-mw/dm/nodes/ve.dm.MWAlienExtensionNode.js",
|
||||
"modules/ve-mw/ce/nodes/ve.ce.MWAlienExtensionNode.js",
|
||||
"modules/ve-mw/ui/inspectors/ve.ui.MWAlienExtensionInspector.js",
|
||||
"modules/ve-mw/ui/tools/ve.ui.MWAlienExtensionInspectorTool.js"
|
||||
"modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js"
|
||||
],
|
||||
"styles": [
|
||||
"modules/ve-mw/ui/styles/inspectors/ve.ui.MWAlienExtensionInspector.css"
|
||||
|
@ -1531,9 +1531,6 @@
|
|||
"dependencies": [
|
||||
"ext.visualEditor.mwcore"
|
||||
],
|
||||
"messages": [
|
||||
"visualeditor-mwalienextensioninspector-title"
|
||||
],
|
||||
"targets": [
|
||||
"desktop",
|
||||
"mobile"
|
||||
|
|
|
@ -254,7 +254,6 @@
|
|||
"visualeditor-mainnamespacepagelink": "Project:Main namespace",
|
||||
"visualeditor-media-input-placeholder": "Search for media",
|
||||
"visualeditor-meta-tool": "Options",
|
||||
"visualeditor-mwalienextensioninspector-title": "MediaWiki extension",
|
||||
"visualeditor-mweditmodesource-title": "Switch to source editing?",
|
||||
"visualeditor-mweditmodesource-tool": "Switch to source editing",
|
||||
"visualeditor-mweditmodesource-warning": "You are about to switch to source editing.\nAny changes you've made to this document can be kept, but you will not be able switch back to VisualEditor without saving or reloading the page.\nDo you want to continue?",
|
||||
|
|
|
@ -263,7 +263,6 @@
|
|||
"visualeditor-mainnamespacepagelink": "Name of a page describing the main namespace (NS0) in this project.\n{{doc-important|Do not translate \"Project\"; it is automatically converted to the wiki's project namespace.}}",
|
||||
"visualeditor-media-input-placeholder": "Place holder text for media search input",
|
||||
"visualeditor-meta-tool": "Text of tool in the toolbar the lets users set categories, language links and other page settings.\n{{Identical|Options}}",
|
||||
"visualeditor-mwalienextensioninspector-title": "Used as title for unknown MediaWiki extensions.\n{{Identical|MediaWiki extension}}",
|
||||
"visualeditor-mweditmodesource-title": "Title of dialog to confirm switching to source mode.",
|
||||
"visualeditor-mweditmodesource-tool": "Label for tool that changes edit mode to source editing.",
|
||||
"visualeditor-mweditmodesource-warning": "Warning message show before changing edit mode to source editing. It allows the user to keep the changes or to start source editing from scratch using the message {{msg-mw|Visualeditor-mweditmodesource-warning-switch}} and {{msg-mw|Visualeditor-mweditmodesource-warning-switch-discard}}.",
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*!
|
||||
* 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.ContextItem
|
||||
*
|
||||
* @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 VeMWAlienExtensionContextItem( 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.ContextItem );
|
||||
|
||||
/* Static Properties */
|
||||
|
||||
ve.ui.MWAlienExtensionContextItem.static.name = 'alienExtension';
|
||||
|
||||
ve.ui.MWAlienExtensionContextItem.static.icon = 'alienextension';
|
||||
|
||||
ve.ui.MWAlienExtensionContextItem.static.modelClasses = [ ve.dm.MWAlienExtensionNode ];
|
||||
|
||||
ve.ui.MWAlienExtensionContextItem.static.commandName = 'alienExtension';
|
||||
|
||||
/* Methods */
|
||||
|
||||
/* Registration */
|
||||
|
||||
ve.ui.contextItemFactory.register( ve.ui.MWAlienExtensionContextItem );
|
|
@ -33,9 +33,6 @@ ve.ui.MWAlienExtensionInspector.static.name = 'alienExtension';
|
|||
|
||||
ve.ui.MWAlienExtensionInspector.static.icon = 'alienextension';
|
||||
|
||||
ve.ui.MWAlienExtensionInspector.static.title =
|
||||
OO.ui.deferMsg( 'visualeditor-mwalienextensioninspector-title' );
|
||||
|
||||
ve.ui.MWAlienExtensionInspector.static.nodeModel = ve.dm.MWAlienExtensionNode;
|
||||
|
||||
/* Methods */
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*!
|
||||
* VisualEditor Experimental MediaWiki UserInterface alien extension tool class.
|
||||
*
|
||||
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
||||
* @license The MIT License (MIT); see LICENSE.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* Modeless dialog for inspecting unsupported MediaWiki extension nodes.
|
||||
*
|
||||
* @class
|
||||
* @extends ve.ui.InspectorTool
|
||||
* @constructor
|
||||
* @param {OO.ui.ToolGroup} toolGroup
|
||||
* @param {Object} [config] Configuration options
|
||||
*/
|
||||
ve.ui.MWAlienExtensionInspectorTool = function VeUiMWAlienExtensionInspectorTool( toolGroup, config ) {
|
||||
ve.ui.InspectorTool.call( this, toolGroup, config );
|
||||
};
|
||||
OO.inheritClass( ve.ui.MWAlienExtensionInspectorTool, ve.ui.InspectorTool );
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.name = 'alienExtension';
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.group = 'object';
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.icon = 'alienextension';
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.title =
|
||||
OO.ui.deferMsg( 'visualeditor-mwalienextensioninspector-title' );
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.modelClasses = [ ve.dm.MWAlienExtensionNode ];
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.commandName = 'alienExtension';
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.autoAddToCatchall = false;
|
||||
ve.ui.MWAlienExtensionInspectorTool.static.autoAddToGroup = false;
|
||||
ve.ui.toolFactory.register( ve.ui.MWAlienExtensionInspectorTool );
|
Loading…
Reference in a new issue