mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "Create an underline tool"
This commit is contained in:
commit
ffc513fcf3
|
@ -34,6 +34,7 @@ $messages['en'] = array(
|
|||
'visualeditor-annotationbutton-link-tooltip' => 'Link',
|
||||
'visualeditor-annotationbutton-language-tooltip' => 'Language',
|
||||
'visualeditor-annotationbutton-strikethrough-tooltip' => 'Strikethrough',
|
||||
'visualeditor-annotationbutton-underline-tooltip' => 'Underline',
|
||||
'visualeditor-beta-label' => 'beta',
|
||||
'visualeditor-beta-warning' => 'VisualEditor is in \'beta\'. You may encounter software issues, and you may not be able to edit parts of the page. Click "{{int:visualeditor-ca-editsource}}" to switch to wikitext mode – unsaved changes will be lost.',
|
||||
'visualeditor-beta-appendix' => 'beta',
|
||||
|
@ -253,6 +254,8 @@ See also:
|
|||
{{Identical|Language}}',
|
||||
'visualeditor-annotationbutton-strikethrough-tooltip' => 'Tooltip text for strikethrough button.
|
||||
{{Identical|Strikethrough}}',
|
||||
'visualeditor-annotationbutton-underline-tooltip' => 'Tooltip text for underline button.
|
||||
{{Identical|Underline}}',
|
||||
'visualeditor-beta-label' => 'Text of tool in the toolbar that highlights that VisualEditor is still in beta.
|
||||
{{Identical|Beta}}',
|
||||
'visualeditor-beta-warning' => "Note shown when user clicks on 'beta' label in VisualEditor, warning users that the software may have issues",
|
||||
|
|
|
@ -724,6 +724,7 @@ $wgResourceModules += array(
|
|||
've/ui/widgets/ve.ui.LanguageInputWidget.js',
|
||||
've/ui/tools/buttons/ve.ui.CodeButtonTool.js',
|
||||
've/ui/tools/buttons/ve.ui.StrikethroughButtonTool.js',
|
||||
've/ui/tools/buttons/ve.ui.UnderlineButtonTool.js',
|
||||
),
|
||||
'dependencies' => array(
|
||||
'ext.visualEditor.core',
|
||||
|
@ -736,6 +737,7 @@ $wgResourceModules += array(
|
|||
'visualeditor-mwmathinspector-title',
|
||||
'visualeditor-annotationbutton-language-tooltip',
|
||||
'visualeditor-annotationbutton-strikethrough-tooltip',
|
||||
'visualeditor-annotationbutton-underline-tooltip',
|
||||
),
|
||||
),
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ ve.init.mw.ViewPageTarget.compatibility = {
|
|||
ve.init.mw.ViewPageTarget.static.toolbarTools = [
|
||||
{ 'items': [ 'undo', 'redo' ] },
|
||||
{ 'items': [ 'mwFormat' ] },
|
||||
{ 'items': [ 'bold', 'italic', 'mwLink', 'language', 'code', 'strikethrough', 'clear' ] },
|
||||
{ 'items': [ 'bold', 'italic', 'strikethrough', 'underline', 'mwLink', 'language', 'code', 'clear' ] },
|
||||
{ 'items': [ 'number', 'bullet', 'outdent', 'indent' ] },
|
||||
{ 'items': [ 'mwMediaInsert', 'mwReference', 'mwReferenceList', 'mwTransclusion', 'mwMath', 'mwHiero' ] }
|
||||
];
|
||||
|
|
|
@ -32,7 +32,7 @@ ve.mixinClass( ve.init.Target, ve.EventEmitter );
|
|||
ve.init.Target.static.toolbarTools = [
|
||||
{ 'items': ['undo', 'redo'] },
|
||||
{ 'items': ['format'] },
|
||||
{ 'items': ['bold', 'italic', 'link', 'code', 'language', 'strikethrough', 'clear'] },
|
||||
{ 'items': ['bold', 'italic', 'link', 'code', 'language', 'underline', 'strikethrough', 'clear'] },
|
||||
{ 'items': ['number', 'bullet', 'outdent', 'indent'] }
|
||||
];
|
||||
|
||||
|
@ -43,6 +43,7 @@ ve.init.Target.static.surfaceCommands = [
|
|||
//'language',
|
||||
'undo',
|
||||
'redo',
|
||||
//'underline',
|
||||
//'strikethrough',
|
||||
'indent',
|
||||
'outdent'
|
||||
|
|
43
modules/ve/ui/tools/buttons/ve.ui.UnderlineButtonTool.js
Normal file
43
modules/ve/ui/tools/buttons/ve.ui.UnderlineButtonTool.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*!
|
||||
* 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' );
|
Loading…
Reference in a new issue