2013-08-27 23:28:29 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki UserInterface format tool classes.
|
|
|
|
*
|
2019-01-01 13:24:23 +00:00
|
|
|
* @copyright 2011-2019 VisualEditor Team and others; see AUTHORS.txt
|
2013-08-27 23:28:29 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface heading 1 tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Heading1FormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWHeading1FormatTool = function VeUiMWHeading1FormatTool() {
|
|
|
|
ve.ui.MWHeading1FormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWHeading1FormatTool, ve.ui.Heading1FormatTool );
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWHeading1FormatTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading1' );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWHeading1FormatTool.static.format = { type: 'mwHeading', attributes: { level: 1 } };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading1FormatTool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface heading 2 tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Heading2FormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWHeading2FormatTool = function VeUiMWHeading2FormatTool() {
|
|
|
|
ve.ui.MWHeading2FormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWHeading2FormatTool, ve.ui.Heading2FormatTool );
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWHeading2FormatTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading2' );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWHeading2FormatTool.static.format = { type: 'mwHeading', attributes: { level: 2 } };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading2FormatTool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface heading 3 tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Heading3FormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWHeading3FormatTool = function VeUiMWHeading3FormatTool() {
|
|
|
|
ve.ui.MWHeading3FormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWHeading3FormatTool, ve.ui.Heading3FormatTool );
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWHeading3FormatTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading3' );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWHeading3FormatTool.static.format = { type: 'mwHeading', attributes: { level: 3 } };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading3FormatTool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface heading 4 tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Heading4FormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWHeading4FormatTool = function VeUiMWHeading4FormatTool() {
|
|
|
|
ve.ui.MWHeading4FormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWHeading4FormatTool, ve.ui.Heading4FormatTool );
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWHeading4FormatTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading4' );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWHeading4FormatTool.static.format = { type: 'mwHeading', attributes: { level: 4 } };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading4FormatTool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface heading 5 tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Heading5FormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWHeading5FormatTool = function VeUiMWHeading5FormatTool() {
|
|
|
|
ve.ui.MWHeading5FormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWHeading5FormatTool, ve.ui.Heading5FormatTool );
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWHeading5FormatTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading5' );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWHeading5FormatTool.static.format = { type: 'mwHeading', attributes: { level: 5 } };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading5FormatTool );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface heading 6 tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Heading6FormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWHeading6FormatTool = function VeUiMWHeading6FormatTool() {
|
|
|
|
ve.ui.MWHeading6FormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWHeading6FormatTool, ve.ui.Heading6FormatTool );
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWHeading6FormatTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-formatdropdown-format-mw-heading6' );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWHeading6FormatTool.static.format = { type: 'mwHeading', attributes: { level: 6 } };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWHeading6FormatTool );
|
|
|
|
|
2015-08-02 11:24:15 +00:00
|
|
|
( function () {
|
|
|
|
var i;
|
|
|
|
for ( i = 1; i <= 6; i++ ) {
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'heading' + i, 'format', 'convert',
|
|
|
|
{ args: [ 'mwHeading', { level: i } ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2016-11-12 14:43:43 +00:00
|
|
|
}() );
|
2015-08-02 11:24:15 +00:00
|
|
|
|
2013-08-27 23:28:29 +00:00
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface preformatted tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.PreformattedFormatTool
|
|
|
|
* @constructor
|
2013-10-23 23:27:12 +00:00
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-08-27 23:28:29 +00:00
|
|
|
*/
|
2016-08-22 21:44:59 +00:00
|
|
|
ve.ui.MWPreformattedFormatTool = function VeUiMWPreformattedFormatTool() {
|
|
|
|
ve.ui.MWPreformattedFormatTool.super.apply( this, arguments );
|
2013-08-27 23:28:29 +00:00
|
|
|
};
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ui.MWPreformattedFormatTool, ve.ui.PreformattedFormatTool );
|
2014-08-22 20:50:48 +00:00
|
|
|
ve.ui.MWPreformattedFormatTool.static.format = { type: 'mwPreformatted' };
|
2013-08-27 23:28:29 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWPreformattedFormatTool );
|
2015-08-02 11:24:15 +00:00
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'preformatted', 'format', 'convert',
|
|
|
|
{ args: [ 'mwPreformatted' ], supportedSelections: [ 'linear' ] }
|
|
|
|
)
|
|
|
|
);
|