mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
d8ee3c2c29
Stack traces, line numbers, etc. All the approaches I've seen are bad hacks. This is the best way to go. Change-Id: Ib12e9d2ecfe610bcc89d046005e35cc13efa3d99
36 lines
806 B
JavaScript
36 lines
806 B
JavaScript
/**
|
|
* VisualEditor user interface Tool class.
|
|
*
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Creates an ve.ui.Tool object.
|
|
*
|
|
* @class
|
|
* @constructor
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
* @param {String} name
|
|
*/
|
|
ve.ui.Tool = function ( toolbar, name, title ) {
|
|
this.toolbar = toolbar;
|
|
this.name = name;
|
|
this.title = title;
|
|
this.$ = $( '<div class="es-tool"></div>' ).attr( 'title', this.title );
|
|
};
|
|
|
|
/* Static Members */
|
|
|
|
ve.ui.Tool.tools = {};
|
|
|
|
/* Methods */
|
|
|
|
ve.ui.Tool.prototype.updateState = function () {
|
|
throw new Error( 'Tool.updateState not implemented in this subclass:' + this.constructor );
|
|
};
|
|
|
|
ve.ui.Tool.prototype.clearState = function () {
|
|
this.$.removeClass( 'es-toolbarButtonTool-down' );
|
|
};
|