Peter.C has uploaded a new change for review. https://gerrit.wikimedia.org/r/78019
Change subject: Create strikethrough text style button ...................................................................... Create strikethrough text style button Experimental to avoid making toolbar too long Bug: 51610 Change-Id: I1eb5b1361d6058a6e1533ab62c0aa7e21c9fc090 --- 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.StrikethroughButtonTool.js 5 files changed, 50 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/19/78019/1 diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php index 149378c..20fd99f 100644 --- a/VisualEditor.i18n.php +++ b/VisualEditor.i18n.php @@ -33,6 +33,7 @@ 'visualeditor-annotationbutton-italic-tooltip' => 'Italic', 'visualeditor-annotationbutton-link-tooltip' => 'Link', 'visualeditor-annotationbutton-language-tooltip' => 'Language', + 'visualeditor-annotationbutton-strikethrough-tooltip' => 'Strikethrough', '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', @@ -245,6 +246,7 @@ {{Identical|Link}}', 'visualeditor-annotationbutton-language-tooltip' => 'Tooltip text for language button. {{Identical|Language}}', + 'visualeditor-annotationbutton-strikethrough-tooltip' => 'Tooltip text for strikethrough button', '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", diff --git a/VisualEditor.php b/VisualEditor.php index 7eef8eb..c222525 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -721,6 +721,7 @@ 've/ui/tools/buttons/ve.ui.LanguageButtonTool.js', 've/ui/widgets/ve.ui.LanguageInputWidget.js', 've/ui/tools/buttons/ve.ui.CodeButtonTool.js', + 've/ui/tools/buttons/ve.ui.StrikethroughButtonTool.js', ), 'dependencies' => array( 'ext.visualEditor.core', @@ -730,6 +731,7 @@ // VE messages needed by code that is only in experimental mode 'visualeditor-mwmathinspector-title', 'visualeditor-annotationbutton-language-tooltip', + 'visualeditor-annotationbutton-strikethrough-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 5856153..3bfa364 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', 'mwLink', 'language', 'code', 'clear' ] }, + { 'items': [ 'bold', 'italic', 'mwLink', 'language', 'code', 'strikethrough', 'clear' ] }, { 'items': [ 'number', 'bullet', 'outdent', 'indent' ] }, { 'items': [ 'mwMediaInsert', 'mwReference', 'mwReferenceList', 'mwTransclusion', 'mwMath' ] } ]; diff --git a/modules/ve/init/ve.init.Target.js b/modules/ve/init/ve.init.Target.js index 54db1d6..28c246d 100644 --- a/modules/ve/init/ve.init.Target.js +++ b/modules/ve/init/ve.init.Target.js @@ -32,7 +32,7 @@ ve.init.Target.static.toolbarTools = [ { 'items': ['undo', 'redo'] }, { 'items': ['format'] }, - { 'items': ['bold', 'italic', 'link', 'code', 'language', 'clear'] }, + { 'items': ['bold', 'italic', 'link', 'code', 'language', 'strikethrough', 'clear'] }, { 'items': ['number', 'bullet', 'outdent', 'indent'] } ]; @@ -43,6 +43,7 @@ //'language', 'undo', 'redo', + //'strikethrough', 'indent', 'outdent' ]; diff --git a/modules/ve/ui/tools/buttons/ve.ui.StrikethroughButtonTool.js b/modules/ve/ui/tools/buttons/ve.ui.StrikethroughButtonTool.js new file mode 100644 index 0000000..dc6a873 --- /dev/null +++ b/modules/ve/ui/tools/buttons/ve.ui.StrikethroughButtonTool.js @@ -0,0 +1,43 @@ +/*! + * VisualEditor UserInterface StrikethroughButtonTool class. + * + * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt + * @license The MIT License (MIT); see LICENSE.txt + */ + +/** + * UserInterface code button tool. + * + * @class + * @extends ve.ui.AnnotationButtonTool + * @constructor + * @param {ve.ui.SurfaceToolbar} toolbar + * @param {Object} [config] Config options + */ +ve.ui.StrikethroughButtonTool = function VeUiStrikethroughButtonTool( toolbar, config ) { + // Parent constructor + ve.ui.AnnotationButtonTool.call( this, toolbar, config ); +}; + +/* Inheritance */ + +ve.inheritClass( ve.ui.StrikethroughButtonTool, ve.ui.AnnotationButtonTool ); + +/* Static Properties */ + +ve.ui.StrikethroughButtonTool.static.name = 'strikethrough'; + +ve.ui.StrikethroughButtonTool.static.icon = { + 'default': 'strikethrough-a', + 'en': 'strikethrough-s' +}; + +ve.ui.StrikethroughButtonTool.static.titleMessage = 'visualeditor-annotationbutton-strikethrough-tooltip'; + +ve.ui.StrikethroughButtonTool.static.annotation = { 'name': 'textStyle/strike' }; + +/* Registration */ + +ve.ui.toolFactory.register( 'strikethrough', ve.ui.StrikethroughButtonTool ); + +ve.ui.commandRegistry.register( 'strikethrough', 'annotation', 'toggle', 'textStyle/strike' ); -- To view, visit https://gerrit.wikimedia.org/r/78019 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1eb5b1361d6058a6e1533ab62c0aa7e21c9fc090 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Peter.C <peterc...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits