jenkins-bot has submitted this change and it was merged.
Change subject: Create a subscript tool
......................................................................
Create a subscript tool
Bug: 51612
Change-Id: Ia05e09a411213cbc035ad9dd3d3156d57f8e102c
---
M VisualEditor.i18n.php
M VisualEditor.php
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
M modules/ve/init/ve.init.Target.js
A modules/ve/ui/tools/buttons/ve.ui.SubscriptButtonTool.js
5 files changed, 50 insertions(+), 2 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index ed05511..c60e3a6 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -34,6 +34,7 @@
'visualeditor-annotationbutton-link-tooltip' => 'Link',
'visualeditor-annotationbutton-language-tooltip' => 'Language',
'visualeditor-annotationbutton-strikethrough-tooltip' =>
'Strikethrough',
+ 'visualeditor-annotationbutton-subscript-tooltip' => 'Subscript',
'visualeditor-annotationbutton-superscript-tooltip' => 'Superscript',
'visualeditor-annotationbutton-underline-tooltip' => 'Underline',
'visualeditor-beta-label' => 'beta',
@@ -254,6 +255,8 @@
{{Identical|Language}}',
'visualeditor-annotationbutton-strikethrough-tooltip' => 'Tooltip text
for strikethrough button.
{{Identical|Strikethrough}}',
+ 'visualeditor-annotationbutton-subscript-tooltip' => 'Tooltip text for
subscript button.
+{{Identical|Subscript}}',
'visualeditor-annotationbutton-superscript-tooltip' => 'Tooltip text
for superscript button.
{{Identical|Superscript}}',
'visualeditor-annotationbutton-underline-tooltip' => 'Tooltip text for
underline button.
diff --git a/VisualEditor.php b/VisualEditor.php
index 5f444f5..fe25f10 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -732,6 +732,7 @@
'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.SubscriptButtonTool.js',
've/ui/tools/buttons/ve.ui.SuperscriptButtonTool.js',
've/ui/tools/buttons/ve.ui.UnderlineButtonTool.js',
),
@@ -746,6 +747,7 @@
'visualeditor-mwmathinspector-title',
'visualeditor-annotationbutton-language-tooltip',
'visualeditor-annotationbutton-strikethrough-tooltip',
+ 'visualeditor-annotationbutton-subscript-tooltip',
'visualeditor-annotationbutton-superscript-tooltip',
'visualeditor-annotationbutton-underline-tooltip',
),
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 3caca8d..6732dd4 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -170,7 +170,8 @@
ve.init.mw.ViewPageTarget.static.toolbarTools = [
{ 'items': [ 'undo', 'redo' ] },
{ 'items': [ 'mwFormat' ] },
- { 'items': [ 'bold', 'italic', 'strikethrough', 'superscript',
'underline', 'mwLink', 'language', 'code', 'clear' ] },
+ { 'items': [ 'bold', 'italic', 'strikethrough', 'subscript',
'superscript',
+ 'underline', 'mwLink', 'language', 'code', 'clear' ] },
{ 'items': [ 'number', 'bullet', 'outdent', 'indent' ] },
{ 'items': [ 'mwMediaInsert', 'mwReference', 'mwReferenceList',
'mwTransclusion', 'mwMath', 'mwHiero' ] }
];
diff --git a/modules/ve/init/ve.init.Target.js
b/modules/ve/init/ve.init.Target.js
index c04f7ed..8d3a78a 100644
--- a/modules/ve/init/ve.init.Target.js
+++ b/modules/ve/init/ve.init.Target.js
@@ -32,7 +32,8 @@
ve.init.Target.static.toolbarTools = [
{ 'items': ['undo', 'redo'] },
{ 'items': ['format'] },
- { 'items': ['bold', 'italic', 'strikethrough', 'superscript',
'underline', 'link', 'code', 'language', 'clear'] },
+ { 'items': ['bold', 'italic', 'strikethrough', 'subscript',
'superscript',
+ 'underline', 'link', 'code', 'language', 'clear'] },
{ 'items': ['number', 'bullet', 'outdent', 'indent'] }
];
@@ -40,6 +41,7 @@
'bold',
'italic',
//'strikethrough',
+ //'subscript',
//'superscript',
//'underline',
'link',
diff --git a/modules/ve/ui/tools/buttons/ve.ui.SubscriptButtonTool.js
b/modules/ve/ui/tools/buttons/ve.ui.SubscriptButtonTool.js
new file mode 100644
index 0000000..6d502d3
--- /dev/null
+++ b/modules/ve/ui/tools/buttons/ve.ui.SubscriptButtonTool.js
@@ -0,0 +1,40 @@
+/*!
+ * VisualEditor UserInterface SubscriptButtonTool class.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * UserInterface subscript button tool.
+ *
+ * @class
+ * @extends ve.ui.AnnotationButtonTool
+ * @constructor
+ * @param {ve.ui.SurfaceToolbar} toolbar
+ * @param {Object} [config] Config options
+ */
+ve.ui.SubscriptButtonTool = function VeUiSubscriptButtonTool( toolbar, config
) {
+ // Parent constructor
+ ve.ui.AnnotationButtonTool.call( this, toolbar, config );
+};
+
+/* Inheritance */
+
+ve.inheritClass( ve.ui.SubscriptButtonTool, ve.ui.AnnotationButtonTool );
+
+/* Static Properties */
+
+ve.ui.SubscriptButtonTool.static.name = 'subscript';
+
+ve.ui.SubscriptButtonTool.static.icon = 'subscript';
+
+ve.ui.SubscriptButtonTool.static.titleMessage =
'visualeditor-annotationbutton-subscript-tooltip';
+
+ve.ui.SubscriptButtonTool.static.annotation = { 'name': 'textStyle/subScript'
};
+
+/* Registration */
+
+ve.ui.toolFactory.register( 'subscript', ve.ui.SubscriptButtonTool );
+
+ve.ui.commandRegistry.register( 'subscript', 'annotation', 'toggle',
'textStyle/subScript' );
--
To view, visit https://gerrit.wikimedia.org/r/78495
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia05e09a411213cbc035ad9dd3d3156d57f8e102c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Steven Zhang <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits