mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-30 00:55:00 +00:00
eca0a08ad9
Update VE core submodule to master (84ced37) and update calling code for changes in OOUI. Depends on Ic967b88d55daf48d365487e17f76488b3f02c60f and Ib599b9bd5028e2df084fcc3da657aeb7f1569d2a New changes: 94f03c3 Undefined variables first in selectNodes 62b5648 Localisation updates from https://translatewiki.net. 10c5a18 Don't descend into handlesOwnChildren nodes in selectNodes 4ed2432 Update jquery.client to MW's master (45192156d7) d7e24b8 Localisation updates from https://translatewiki.net. babb9da Localisation updates from https://translatewiki.net. 4639d18 Localisation updates from https://translatewiki.net. a561537 Localisation updates from https://translatewiki.net. 8f7053a Localisation updates from https://translatewiki.net. 7112cc2 Update OOjs UI to v0.1.0-pre (a290673bbd) Change-Id: Ie7d58472619509782f23a7dedc1ec27c3dcc7543
138 lines
5.6 KiB
JavaScript
138 lines
5.6 KiB
JavaScript
/*!
|
|
* VisualEditor MediaWiki UserInterface format tool classes.
|
|
*
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* MediaWiki UserInterface heading 1 tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Heading1FormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWHeading1FormatTool = function VeUiMWHeading1FormatTool( toolGroup, config ) {
|
|
ve.ui.Heading1FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWHeading1FormatTool, ve.ui.Heading1FormatTool );
|
|
ve.ui.MWHeading1FormatTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading1' );
|
|
ve.ui.MWHeading1FormatTool.static.format = { 'type': 'mwHeading', 'attributes': { 'level': 1 } };
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading1FormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'heading1', 'format', 'convert', 'mwHeading', { 'level': 1 } ) );
|
|
|
|
/**
|
|
* MediaWiki UserInterface heading 2 tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Heading2FormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWHeading2FormatTool = function VeUiMWHeading2FormatTool( toolGroup, config ) {
|
|
ve.ui.Heading2FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWHeading2FormatTool, ve.ui.Heading2FormatTool );
|
|
ve.ui.MWHeading2FormatTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading2' );
|
|
ve.ui.MWHeading2FormatTool.static.format = { 'type': 'mwHeading', 'attributes': { 'level': 2 } };
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading2FormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'heading2', 'format', 'convert', 'mwHeading', { 'level': 2 } ) );
|
|
|
|
/**
|
|
* MediaWiki UserInterface heading 3 tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Heading3FormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWHeading3FormatTool = function VeUiMWHeading3FormatTool( toolGroup, config ) {
|
|
ve.ui.Heading3FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWHeading3FormatTool, ve.ui.Heading3FormatTool );
|
|
ve.ui.MWHeading3FormatTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading3' );
|
|
ve.ui.MWHeading3FormatTool.static.format = { 'type': 'mwHeading', 'attributes': { 'level': 3 } };
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading3FormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'heading3', 'format', 'convert', 'mwHeading', { 'level': 3 } ) );
|
|
|
|
/**
|
|
* MediaWiki UserInterface heading 4 tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Heading4FormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWHeading4FormatTool = function VeUiMWHeading4FormatTool( toolGroup, config ) {
|
|
ve.ui.Heading4FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWHeading4FormatTool, ve.ui.Heading4FormatTool );
|
|
ve.ui.MWHeading4FormatTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading4' );
|
|
ve.ui.MWHeading4FormatTool.static.format = { 'type': 'mwHeading', 'attributes': { 'level': 4 } };
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading4FormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'heading4', 'format', 'convert', 'mwHeading', { 'level': 4 } ) );
|
|
|
|
/**
|
|
* MediaWiki UserInterface heading 5 tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Heading5FormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWHeading5FormatTool = function VeUiMWHeading5FormatTool( toolGroup, config ) {
|
|
ve.ui.Heading5FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWHeading5FormatTool, ve.ui.Heading5FormatTool );
|
|
ve.ui.MWHeading5FormatTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading5' );
|
|
ve.ui.MWHeading5FormatTool.static.format = { 'type': 'mwHeading', 'attributes': { 'level': 5 } };
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading5FormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'heading5', 'format', 'convert', 'mwHeading', { 'level': 5 } ) );
|
|
|
|
/**
|
|
* MediaWiki UserInterface heading 6 tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.Heading6FormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWHeading6FormatTool = function VeUiMWHeading6FormatTool( toolGroup, config ) {
|
|
ve.ui.Heading6FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWHeading6FormatTool, ve.ui.Heading6FormatTool );
|
|
ve.ui.MWHeading6FormatTool.static.title =
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading6' );
|
|
ve.ui.MWHeading6FormatTool.static.format = { 'type': 'mwHeading', 'attributes': { 'level': 6 } };
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading6FormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'heading6', 'format', 'convert', 'mwHeading', { 'level': 6 } ) );
|
|
|
|
/**
|
|
* MediaWiki UserInterface preformatted tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.PreformattedFormatTool
|
|
* @constructor
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
* @param {Object} [config] Configuration options
|
|
*/
|
|
ve.ui.MWPreformattedFormatTool = function VeUiMWPreformattedFormatTool( toolGroup, config ) {
|
|
ve.ui.FormatTool.call( this, toolGroup, config );
|
|
};
|
|
OO.inheritClass( ve.ui.MWPreformattedFormatTool, ve.ui.PreformattedFormatTool );
|
|
ve.ui.MWPreformattedFormatTool.static.format = { 'type': 'mwPreformatted' };
|
|
ve.ui.toolFactory.register( ve.ui.MWPreformattedFormatTool );
|
|
ve.ui.commandRegistry.register( new ve.ui.Command( 'preformatted', 'format', 'convert', 'mwPreformatted' ) );
|