2013-09-06 00:10:06 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki UserInterface edit mode tool classes.
|
|
|
|
*
|
2015-01-08 23:54:03 +00:00
|
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
2013-09-06 00:10:06 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-01-13 15:18:06 +00:00
|
|
|
* MediaWiki UserInterface edit mode tool.
|
2013-09-06 00:10:06 +00:00
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @abstract
|
2014-03-08 14:17:47 +00:00
|
|
|
* @extends ve.ui.Tool
|
2013-09-06 00:10:06 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Config options
|
|
|
|
*/
|
|
|
|
ve.ui.MWEditModeTool = function VeUiMWEditModeTool( toolGroup, config ) {
|
2014-03-08 14:17:47 +00:00
|
|
|
ve.ui.Tool.call( this, toolGroup, config );
|
2013-09-06 00:10:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2014-03-08 14:17:47 +00:00
|
|
|
OO.inheritClass( ve.ui.MWEditModeTool, ve.ui.Tool );
|
2013-09-06 00:10:06 +00:00
|
|
|
|
|
|
|
/* Static Properties */
|
|
|
|
|
|
|
|
ve.ui.MWEditModeTool.static.group = 'editMode';
|
2014-03-21 18:46:02 +00:00
|
|
|
|
|
|
|
ve.ui.MWEditModeTool.static.autoAddToCatchall = false;
|
|
|
|
|
|
|
|
ve.ui.MWEditModeTool.static.autoAddToGroup = false;
|
2013-09-06 00:10:06 +00:00
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
2014-03-08 14:17:47 +00:00
|
|
|
/** */
|
2013-09-06 00:10:06 +00:00
|
|
|
ve.ui.MWEditModeTool.prototype.onUpdateState = function () {
|
2014-03-08 14:17:47 +00:00
|
|
|
// Parent method
|
2015-08-06 14:22:15 +00:00
|
|
|
ve.ui.MWEditModeTool.super.prototype.onUpdateState.apply( this, arguments );
|
2014-03-08 14:17:47 +00:00
|
|
|
|
2013-09-06 00:10:06 +00:00
|
|
|
this.setActive( false );
|
2015-05-08 23:24:08 +00:00
|
|
|
this.setDisabled( false );
|
2013-09-06 00:10:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface edit mode source tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.MWEditModeTool
|
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Config options
|
|
|
|
*/
|
2015-08-06 14:22:15 +00:00
|
|
|
ve.ui.MWEditModeSourceTool = function VeUiMWEditModeSourceTool() {
|
|
|
|
ve.ui.MWEditModeSourceTool.super.apply( this, arguments );
|
2013-09-06 00:10:06 +00:00
|
|
|
};
|
|
|
|
OO.inheritClass( ve.ui.MWEditModeSourceTool, ve.ui.MWEditModeTool );
|
|
|
|
ve.ui.MWEditModeSourceTool.static.name = 'editModeSource';
|
2015-11-04 14:15:29 +00:00
|
|
|
ve.ui.MWEditModeSourceTool.static.icon = 'wikiText';
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWEditModeSourceTool.static.title =
|
2014-07-14 21:32:49 +00:00
|
|
|
OO.ui.deferMsg( 'visualeditor-mweditmodesource-tool' );
|
2014-04-03 23:54:55 +00:00
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
ve.ui.MWEditModeSourceTool.prototype.onSelect = function () {
|
|
|
|
this.toolbar.getTarget().editSource();
|
|
|
|
this.setActive( false );
|
|
|
|
};
|
2013-09-06 00:10:06 +00:00
|
|
|
ve.ui.toolFactory.register( ve.ui.MWEditModeSourceTool );
|