2014-02-27 15:17:00 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki UserInterface meta tool classes.
|
|
|
|
*
|
2019-01-01 13:24:23 +00:00
|
|
|
* @copyright 2011-2019 VisualEditor Team and others; see AUTHORS.txt
|
2014-02-27 15:17:00 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2016-10-27 21:36:28 +00:00
|
|
|
* MediaWiki UserInterface VE only dialog tool.
|
2014-02-27 15:17:00 +00:00
|
|
|
*
|
|
|
|
* @class
|
2016-10-27 21:36:28 +00:00
|
|
|
* @abstract
|
2015-12-08 13:18:51 +00:00
|
|
|
* @extends ve.ui.WindowTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
2016-10-27 21:36:28 +00:00
|
|
|
*/
|
|
|
|
ve.ui.MWVeOnlyDialogTool = function VeUiMWMetaDialogTool() {
|
|
|
|
ve.ui.MWVeOnlyDialogTool.super.apply( this, arguments );
|
|
|
|
};
|
|
|
|
OO.inheritClass( ve.ui.MWVeOnlyDialogTool, ve.ui.WindowTool );
|
|
|
|
ve.ui.MWVeOnlyDialogTool.prototype.onUpdateState = function () {
|
|
|
|
// Parent method
|
|
|
|
ve.ui.MWVeOnlyDialogTool.super.prototype.onUpdateState.apply( this, arguments );
|
|
|
|
|
|
|
|
// Meta tools are not supported in source mode (yet?)
|
2016-11-30 12:03:56 +00:00
|
|
|
this.setDisabled( !this.toolbar.getSurface() || this.toolbar.getSurface().getMode() === 'source' );
|
2016-10-27 21:36:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface meta dialog tool.
|
|
|
|
*
|
|
|
|
* @class
|
2016-12-18 19:04:20 +00:00
|
|
|
* @extends ve.ui.WindowTool
|
2016-10-27 21:36:28 +00:00
|
|
|
* @constructor
|
2014-02-27 15:17:00 +00:00
|
|
|
* @param {OO.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWMetaDialogTool = function VeUiMWMetaDialogTool() {
|
|
|
|
ve.ui.MWMetaDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2016-12-18 19:04:20 +00:00
|
|
|
OO.inheritClass( ve.ui.MWMetaDialogTool, ve.ui.WindowTool );
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWMetaDialogTool.static.name = 'meta';
|
|
|
|
ve.ui.MWMetaDialogTool.static.group = 'utility';
|
|
|
|
ve.ui.MWMetaDialogTool.static.icon = 'window';
|
|
|
|
ve.ui.MWMetaDialogTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-meta-tool' );
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.MWMetaDialogTool.static.commandName = 'meta';
|
2014-03-21 18:46:02 +00:00
|
|
|
ve.ui.MWMetaDialogTool.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.MWMetaDialogTool.static.autoAddToGroup = false;
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWMetaDialogTool );
|
|
|
|
|
2015-08-02 11:24:15 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'meta', 'window', 'open',
|
|
|
|
{ args: [ 'meta' ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2014-02-27 15:17:00 +00:00
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface page settings tool.
|
|
|
|
*
|
|
|
|
* @class
|
2016-10-27 21:36:28 +00:00
|
|
|
* @extends ve.ui.MWVeOnlyDialogTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWPageSettingsDialogTool = function VeUiMWPageSettingsDialogTool() {
|
|
|
|
ve.ui.MWPageSettingsDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2016-10-27 21:36:28 +00:00
|
|
|
OO.inheritClass( ve.ui.MWPageSettingsDialogTool, ve.ui.MWVeOnlyDialogTool );
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWPageSettingsDialogTool.static.name = 'settings';
|
|
|
|
ve.ui.MWPageSettingsDialogTool.static.group = 'utility';
|
2018-08-16 21:41:31 +00:00
|
|
|
ve.ui.MWPageSettingsDialogTool.static.icon = 'pageSettings';
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWPageSettingsDialogTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-settings-tool' );
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.MWPageSettingsDialogTool.static.commandName = 'meta/settings';
|
2014-03-21 18:46:02 +00:00
|
|
|
ve.ui.MWPageSettingsDialogTool.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.MWPageSettingsDialogTool.static.autoAddToGroup = false;
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWPageSettingsDialogTool );
|
|
|
|
|
2015-08-02 11:24:15 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/settings', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'settings' } ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2014-02-27 15:17:00 +00:00
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface advanced page settings tool.
|
|
|
|
*
|
|
|
|
* @class
|
2016-10-27 21:36:28 +00:00
|
|
|
* @extends ve.ui.MWVeOnlyDialogTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool = function VeUiMWAdvancedPageSettingsDialogTool() {
|
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2016-10-27 21:36:28 +00:00
|
|
|
OO.inheritClass( ve.ui.MWAdvancedPageSettingsDialogTool, ve.ui.MWVeOnlyDialogTool );
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.name = 'advancedSettings';
|
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.group = 'utility';
|
2018-09-08 02:46:12 +00:00
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.icon = 'settings';
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-advancedsettings-tool' );
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.commandName = 'meta/advanced';
|
2014-03-21 18:46:02 +00:00
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.MWAdvancedPageSettingsDialogTool.static.autoAddToGroup = false;
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWAdvancedPageSettingsDialogTool );
|
|
|
|
|
2015-08-02 11:24:15 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/advanced', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'advancedSettings' } ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2014-02-27 15:17:00 +00:00
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface categories tool.
|
|
|
|
*
|
|
|
|
* @class
|
2016-10-27 21:36:28 +00:00
|
|
|
* @extends ve.ui.MWVeOnlyDialogTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWCategoriesDialogTool = function VeUiMWCategoriesDialogTool() {
|
|
|
|
ve.ui.MWCategoriesDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2016-10-27 21:36:28 +00:00
|
|
|
OO.inheritClass( ve.ui.MWCategoriesDialogTool, ve.ui.MWVeOnlyDialogTool );
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWCategoriesDialogTool.static.name = 'categories';
|
|
|
|
ve.ui.MWCategoriesDialogTool.static.group = 'utility';
|
|
|
|
ve.ui.MWCategoriesDialogTool.static.icon = 'tag';
|
|
|
|
ve.ui.MWCategoriesDialogTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-categories-tool' );
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.MWCategoriesDialogTool.static.commandName = 'meta/categories';
|
2014-03-21 18:46:02 +00:00
|
|
|
ve.ui.MWCategoriesDialogTool.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.MWCategoriesDialogTool.static.autoAddToGroup = false;
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWCategoriesDialogTool );
|
|
|
|
|
2015-08-02 11:24:15 +00:00
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/categories', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'categories' } ] }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2014-02-27 15:17:00 +00:00
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface languages tool.
|
|
|
|
*
|
|
|
|
* @class
|
2016-10-27 21:36:28 +00:00
|
|
|
* @extends ve.ui.MWVeOnlyDialogTool
|
2014-02-27 15:17:00 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
2015-12-08 13:18:51 +00:00
|
|
|
ve.ui.MWLanguagesDialogTool = function VeUiMWLanguagesDialogTool() {
|
|
|
|
ve.ui.MWLanguagesDialogTool.super.apply( this, arguments );
|
2014-02-27 15:17:00 +00:00
|
|
|
};
|
2016-10-27 21:36:28 +00:00
|
|
|
OO.inheritClass( ve.ui.MWLanguagesDialogTool, ve.ui.MWVeOnlyDialogTool );
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWLanguagesDialogTool.static.name = 'languages';
|
|
|
|
ve.ui.MWLanguagesDialogTool.static.group = 'utility';
|
2015-04-16 20:46:49 +00:00
|
|
|
ve.ui.MWLanguagesDialogTool.static.icon = 'textLanguage';
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.MWLanguagesDialogTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-languages-tool' );
|
2014-04-02 23:29:04 +00:00
|
|
|
ve.ui.MWLanguagesDialogTool.static.commandName = 'meta/languages';
|
2014-03-21 18:46:02 +00:00
|
|
|
ve.ui.MWLanguagesDialogTool.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.MWLanguagesDialogTool.static.autoAddToGroup = false;
|
2014-02-27 15:17:00 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWLanguagesDialogTool );
|
2015-08-02 11:24:15 +00:00
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/languages', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'languages' } ] }
|
|
|
|
)
|
|
|
|
);
|
2016-12-18 19:04:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface TemplatesUsed tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.WindowTool
|
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.Toolbar} toolbar
|
|
|
|
* @param {Object} [config] Configuration options
|
|
|
|
*/
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool = function VeUiMWTemplatesUsedDialogTool() {
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool.super.apply( this, arguments );
|
|
|
|
};
|
|
|
|
OO.inheritClass( ve.ui.MWTemplatesUsedDialogTool, ve.ui.WindowTool );
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.name = 'templatesUsed';
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.group = 'utility';
|
2017-07-06 16:52:56 +00:00
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.icon = 'puzzle';
|
2016-12-18 19:04:20 +00:00
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-templatesused-tool' );
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.commandName = 'meta/templatesUsed';
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.autoAddToCatchall = false;
|
|
|
|
ve.ui.MWTemplatesUsedDialogTool.static.autoAddToGroup = false;
|
|
|
|
ve.ui.toolFactory.register( ve.ui.MWTemplatesUsedDialogTool );
|
|
|
|
|
|
|
|
ve.ui.commandRegistry.register(
|
|
|
|
new ve.ui.Command(
|
|
|
|
'meta/templatesUsed', 'window', 'open',
|
|
|
|
{ args: [ 'meta', { page: 'templatesUsed' } ] }
|
|
|
|
)
|
|
|
|
);
|