2013-09-06 00:10:06 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor MediaWiki UserInterface edit mode tool classes.
|
|
|
|
*
|
2014-01-05 12:05:05 +00:00
|
|
|
* @copyright 2011-2014 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
|
|
|
|
* @extends OO.ui.Tool
|
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Config options
|
|
|
|
*/
|
|
|
|
ve.ui.MWEditModeTool = function VeUiMWEditModeTool( toolGroup, config ) {
|
|
|
|
OO.ui.Tool.call( this, toolGroup, config );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
OO.inheritClass( ve.ui.MWEditModeTool, OO.ui.Tool );
|
|
|
|
|
|
|
|
/* 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 */
|
|
|
|
|
|
|
|
ve.ui.MWEditModeTool.prototype.onUpdateState = function () {
|
|
|
|
this.setActive( false );
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MediaWiki UserInterface edit mode source tool.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.MWEditModeTool
|
|
|
|
* @constructor
|
|
|
|
* @param {OO.ui.ToolGroup} toolGroup
|
|
|
|
* @param {Object} [config] Config options
|
|
|
|
*/
|
|
|
|
ve.ui.MWEditModeSourceTool = function VeUiMWEditModeSourceTool( toolGroup, config ) {
|
|
|
|
ve.ui.MWEditModeTool.call( this, toolGroup, config );
|
|
|
|
};
|
|
|
|
OO.inheritClass( ve.ui.MWEditModeSourceTool, ve.ui.MWEditModeTool );
|
|
|
|
ve.ui.MWEditModeSourceTool.static.name = 'editModeSource';
|
|
|
|
ve.ui.MWEditModeSourceTool.static.icon = 'source';
|
2014-02-12 21:45:37 +00:00
|
|
|
ve.ui.MWEditModeSourceTool.static.title =
|
|
|
|
OO.ui.deferMsg( 'visualeditor-mweditmodesource-title' );
|
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 );
|