mediawiki-extensions-Visual.../modules/ve/ui/tools/buttons/ve.ui.UnderlineButtonTool.js
Steven Zhang 3c65d830f2 Create an underline tool
Bug: 51609
Change-Id: I65246d7eeb154950c35a1cb70909a113080c2323
2013-08-15 12:16:01 -07:00

44 lines
1.2 KiB
JavaScript

/*!
* VisualEditor UserInterface UnderlineButtonTool class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* UserInterface underline button tool.
*
* @class
* @extends ve.ui.AnnotationButtonTool
* @constructor
* @param {ve.ui.SurfaceToolbar} toolbar
* @param {Object} [config] Config options
*/
ve.ui.UnderlineButtonTool = function VeUiUnderlineButtonTool( toolbar, config ) {
// Parent constructor
ve.ui.AnnotationButtonTool.call( this, toolbar, config );
};
/* Inheritance */
ve.inheritClass( ve.ui.UnderlineButtonTool, ve.ui.AnnotationButtonTool );
/* Static Properties */
ve.ui.UnderlineButtonTool.static.name = 'underline';
ve.ui.UnderlineButtonTool.static.icon = {
'default': 'underline-a',
'en': 'underline-u'
};
ve.ui.UnderlineButtonTool.static.titleMessage = 'visualeditor-annotationbutton-underline-tooltip';
ve.ui.UnderlineButtonTool.static.annotation = { 'name': 'textStyle/underline' };
/* Registration */
ve.ui.toolFactory.register( 'underline', ve.ui.UnderlineButtonTool );
ve.ui.commandRegistry.register( 'underline', 'annotation', 'toggle', 'textStyle/underline' );