jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350546 )
Change subject: Use consistent label for button across editors ...................................................................... Use consistent label for button across editors Change-Id: I1a299522e95cdb4a6e5bdbdda1c65d4fcec22133 --- M extension.json M i18n/en.json M i18n/qqq.json M resources/ext.CodeMirror.js 4 files changed, 5 insertions(+), 20 deletions(-) Approvals: Pastakhov: Looks good to me, approved jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/extension.json b/extension.json index c592dab..9575060 100644 --- a/extension.json +++ b/extension.json @@ -37,8 +37,7 @@ "ext.CodeMirror.less" ], "messages": [ - "codemirror-enable-label", - "codemirror-disable-label" + "codemirror-toggle-label" ] }, "ext.CodeMirror.lib": { diff --git a/i18n/en.json b/i18n/en.json index 425efaf..4ed7044 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -5,7 +5,5 @@ ] }, "codemirror-desc": "Provides syntax highlighting in wikitext editor", - "codemirror-enable-label": "Enable CodeMirror (Syntax highlight)", - "codemirror-disable-label": "Disable CodeMirror (Syntax highlight)", "codemirror-toggle-label": "Syntax highlighting" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 81cc890..d2979df 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -8,7 +8,5 @@ ] }, "codemirror-desc": "{{desc|name=Code Mirror|url=https://www.mediawiki.org/wiki/Extension:CodeMirror}}\n\nAdditional info: Discription of \"Syntax highlighting\" in wiki\n[[mw:Extension:SyntaxHighlight GeSHi]]", - "codemirror-enable-label": "Title tooltip for button to enable CodeMirror in the editing toolbar.", - "codemirror-disable-label": "Title tooltip for button to disable CodeMirror in the editing toolbar.", "codemirror-toggle-label": "Title tooltip for button to toggle CodeMirror in the editing toolbar." } diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js index 8149619..a47378a 100644 --- a/resources/ext.CodeMirror.js +++ b/resources/ext.CodeMirror.js @@ -251,7 +251,7 @@ codemirror: { tools: { CodeMirror: { - label: mw.msg( useCodeMirror ? 'codemirror-disable-label' : 'codemirror-enable-label' ), + label: mw.msg( 'codemirror-toggle-label' ), type: 'button', offset: [ 2, 2 ], action: { @@ -313,24 +313,14 @@ * @param {Object} [wikiEditor] WikiEditor, if present */ function updateToolbarButton( wikiEditor ) { - var label; - - if ( useCodeMirror ) { - label = mw.msg( 'codemirror-disable-label' ); - } else { - label = mw.msg( 'codemirror-enable-label' ); - } - if ( wikiEditor ) { wikiEditor.modules.toolbar.$toolbar.find( 'a.tool[rel=CodeMirror]' ) .toggleClass( 'tool-codemirror-on', !!useCodeMirror ) - .toggleClass( 'tool-codemirror-off', !useCodeMirror ) - .attr( 'title', label ); + .toggleClass( 'tool-codemirror-off', !useCodeMirror ); } else { $( '#mw-editbutton-codemirror' ) .toggleClass( 'mw-editbutton-codemirror-on', !!useCodeMirror ) - .toggleClass( 'mw-editbutton-codemirror-off', !useCodeMirror ) - .attr( 'title', label ); + .toggleClass( 'mw-editbutton-codemirror-off', !useCodeMirror ); } } @@ -408,7 +398,7 @@ mw.loader.using( 'mediawiki.toolbar', function () { // If WikiEditor isn't enabled, add CodeMirror button to the default wiki editor toolbar mw.toolbar.addButton( { - speedTip: 'CodeMirror', + speedTip: mw.msg( 'codemirror-toggle-label' ), imageId: 'mw-editbutton-codemirror', onClick: function () { switchCodeMirror(); -- To view, visit https://gerrit.wikimedia.org/r/350546 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a299522e95cdb4a6e5bdbdda1c65d4fcec22133 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/CodeMirror Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Pastakhov <pastak...@yandex.ru> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits