mediawiki-extensions-Visual.../modules/ve2/ui/ve.ui.Tool.js
Rob Moen 7bf15b4377 Copy ui modules to ve2
Switch sandbox demo to use new ui modules
Update VisualEditor.php to use ve2 modules
SpecialPageSandbox working

Change-Id: I8261d6bf6ceb6ae7b7bfa5f61aec6a0121906765
2012-05-21 12:39:36 -07:00

29 lines
615 B
JavaScript

/**
* 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 'Tool.updateState not implemented in this subclass:' + this.constructor;
};
ve.ui.Tool.prototype.clearState = function() {
this.$.removeClass( 'es-toolbarButtonTool-down' );
};