jenkins-bot has submitted this change and it was merged.
Change subject: Create a superscript tool
......................................................................
Create a superscript tool
Bug: 51611
Change-Id: I74b6418542927eeeb7e80d664a30fcaf07b93a13
---
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.SuperscriptButtonTool.js
5 files changed, 50 insertions(+), 4 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index 2571126..ed05511 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-superscript-tooltip' => 'Superscript',
'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.',
@@ -253,6 +254,8 @@
{{Identical|Language}}',
'visualeditor-annotationbutton-strikethrough-tooltip' => 'Tooltip text
for strikethrough button.
{{Identical|Strikethrough}}',
+ 'visualeditor-annotationbutton-superscript-tooltip' => 'Tooltip text
for superscript button.
+{{Identical|Superscript}}',
'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.
diff --git a/VisualEditor.php b/VisualEditor.php
index 0039227..5f444f5 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.SuperscriptButtonTool.js',
've/ui/tools/buttons/ve.ui.UnderlineButtonTool.js',
),
'dependencies' => array(
@@ -745,6 +746,7 @@
'visualeditor-mwmathinspector-title',
'visualeditor-annotationbutton-language-tooltip',
'visualeditor-annotationbutton-strikethrough-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 d073cd7..3caca8d 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,7 @@
ve.init.mw.ViewPageTarget.static.toolbarTools = [
{ 'items': [ 'undo', 'redo' ] },
{ 'items': [ 'mwFormat' ] },
- { 'items': [ 'bold', 'italic', 'strikethrough', 'underline', 'mwLink',
'language', 'code', 'clear' ] },
+ { 'items': [ 'bold', 'italic', 'strikethrough', '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 7cc8a84..c04f7ed 100644
--- a/modules/ve/init/ve.init.Target.js
+++ b/modules/ve/init/ve.init.Target.js
@@ -32,19 +32,20 @@
ve.init.Target.static.toolbarTools = [
{ 'items': ['undo', 'redo'] },
{ 'items': ['format'] },
- { 'items': ['bold', 'italic', 'link', 'code', 'language', 'underline',
'strikethrough', 'clear'] },
+ { 'items': ['bold', 'italic', 'strikethrough', 'superscript',
'underline', 'link', 'code', 'language', 'clear'] },
{ 'items': ['number', 'bullet', 'outdent', 'indent'] }
];
ve.init.Target.static.surfaceCommands = [
'bold',
'italic',
+ //'strikethrough',
+ //'superscript',
+ //'underline',
'link',
//'language',
'undo',
'redo',
- //'underline',
- //'strikethrough',
'indent',
'outdent'
];
diff --git a/modules/ve/ui/tools/buttons/ve.ui.SuperscriptButtonTool.js
b/modules/ve/ui/tools/buttons/ve.ui.SuperscriptButtonTool.js
new file mode 100644
index 0000000..8818a1f
--- /dev/null
+++ b/modules/ve/ui/tools/buttons/ve.ui.SuperscriptButtonTool.js
@@ -0,0 +1,40 @@
+/*!
+ * VisualEditor UserInterface SuperscriptButtonTool class.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * UserInterface superscript button tool.
+ *
+ * @class
+ * @extends ve.ui.AnnotationButtonTool
+ * @constructor
+ * @param {ve.ui.SurfaceToolbar} toolbar
+ * @param {Object} [config] Config options
+ */
+ve.ui.SuperscriptButtonTool = function VeUiSuperscriptButtonTool( toolbar,
config ) {
+ // Parent constructor
+ ve.ui.AnnotationButtonTool.call( this, toolbar, config );
+};
+
+/* Inheritance */
+
+ve.inheritClass( ve.ui.SuperscriptButtonTool, ve.ui.AnnotationButtonTool );
+
+/* Static Properties */
+
+ve.ui.SuperscriptButtonTool.static.name = 'superscript';
+
+ve.ui.SuperscriptButtonTool.static.icon = 'superscript';
+
+ve.ui.SuperscriptButtonTool.static.titleMessage =
'visualeditor-annotationbutton-superscript-tooltip';
+
+ve.ui.SuperscriptButtonTool.static.annotation = { 'name':
'textStyle/superScript' };
+
+/* Registration */
+
+ve.ui.toolFactory.register( 'superscript', ve.ui.SuperscriptButtonTool );
+
+ve.ui.commandRegistry.register( 'superscript', 'annotation', 'toggle',
'textStyle/superScript' );
--
To view, visit https://gerrit.wikimedia.org/r/78490
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I74b6418542927eeeb7e80d664a30fcaf07b93a13
Gerrit-PatchSet: 3
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