jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/343134 )
Change subject: Describe group changes for references and references lists ...................................................................... Describe group changes for references and references lists Bug: T160589 Change-Id: Ifccafdf08704f67027dae2703ff2ded809fb6ab7 --- M includes/CiteHooks.php M modules/ve-cite/i18n/en.json M modules/ve-cite/i18n/qqq.json M modules/ve-cite/ve.dm.MWReferenceNode.js M modules/ve-cite/ve.dm.MWReferencesListNode.js 5 files changed, 46 insertions(+), 6 deletions(-) Approvals: Tchanders: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CiteHooks.php b/includes/CiteHooks.php index b011178..e3ee7e6 100644 --- a/includes/CiteHooks.php +++ b/includes/CiteHooks.php @@ -151,6 +151,12 @@ "ext.visualEditor.mediawiki" ], "messages" => [ + "cite-ve-changedesc-ref-group-both", + "cite-ve-changedesc-ref-group-from", + "cite-ve-changedesc-ref-group-to", + "cite-ve-changedesc-reflist-group-both", + "cite-ve-changedesc-reflist-group-from", + "cite-ve-changedesc-reflist-group-to", "cite-ve-dialog-reference-editing-reused", "cite-ve-dialog-reference-options-group-label", "cite-ve-dialog-reference-options-group-placeholder", diff --git a/modules/ve-cite/i18n/en.json b/modules/ve-cite/i18n/en.json index f3a57bd..6e6f7ae 100644 --- a/modules/ve-cite/i18n/en.json +++ b/modules/ve-cite/i18n/en.json @@ -22,6 +22,12 @@ "visualeditor-cite-tool-name-news": "News", "visualeditor-cite-tool-name-web": "Website", "cite-tool-definition.json": "null", + "cite-ve-changedesc-ref-group-both": "Reference group changed from \"$1\" to \"$2\"", + "cite-ve-changedesc-ref-group-from": "Reference group changed from \"$1\" to the general group", + "cite-ve-changedesc-ref-group-to": "Reference group changed from the general group to \"$1\"", + "cite-ve-changedesc-reflist-group-both": "References list group changed from \"$1\" to \"$2\"", + "cite-ve-changedesc-reflist-group-from": "References list group changed from \"$1\" to the general group", + "cite-ve-changedesc-reflist-group-to": "References list group changed from the general group to \"$1\"", "cite-ve-dialog-reference-editing-reused": "This reference is used $1 {{PLURAL:$1|times}} on this page.", "cite-ve-dialog-reference-options-group-label": "Use this group", "cite-ve-dialog-reference-options-group-placeholder": "General references", @@ -46,4 +52,4 @@ "cite-ve-referenceslist-missingref": "This reference is defined in a template or other generated block, and for now can only be edited in source mode.", "cite-ve-toolbar-group-label": "Cite", "cite-ve-othergroup-item": "$1 reference" -} \ No newline at end of file +} diff --git a/modules/ve-cite/i18n/qqq.json b/modules/ve-cite/i18n/qqq.json index 59efd59..ae99ba8 100644 --- a/modules/ve-cite/i18n/qqq.json +++ b/modules/ve-cite/i18n/qqq.json @@ -33,6 +33,12 @@ "visualeditor-cite-tool-name-news": "Title of tool that inserts a citation for a news.\n{{Identical|News}}", "visualeditor-cite-tool-name-web": "Title of tool that inserts a citation for a website.\n{{Identical|Website}}", "cite-tool-definition.json": "{{ignored}}\nJSON list of objects detailing each citation with name (key referring to a visualeditor-cite-tool-name-x message), icon ('ref-cite-book', 'ref-cite-journal', 'ref-cite-news', 'ref-cite-web'), and template name\n{{Identical|Null}}", + "cite-ve-changedesc-ref-group-both": "Description of a reference changing group\n\nParameters:\n* $1 – the name of the group it was before\n* $2 – the name of the group it is now", + "cite-ve-changedesc-ref-group-from": "Description of a reference changing group to the general group\n\nParameters:\n* $1 – the name of the group it was before", + "cite-ve-changedesc-ref-group-to": "Description of a reference changing group from the general group\n\nParameters:\n* $1 – the name of the group it is now", + "cite-ve-changedesc-reflist-group-both": "Description of a references list changing group\n\nParameters:\n* $1 – the name of the group it was before\n* $2 – the name of the group it is now", + "cite-ve-changedesc-reflist-group-from": "Description of a references list changing group to the general group\n\nParameters:\n* $1 – the name of the group it was before", + "cite-ve-changedesc-reflist-group-to": "Description of a references list changing group from the general group\n\nParameters:\n* $1 – the name of the group it is now", "cite-ve-dialog-reference-editing-reused": "Text shown at the top of the reference dialog when editing a reference that is used multiple times.\n\nParameters:\n* $1 - Number of times used. This is always greater than 1.", "cite-ve-dialog-reference-options-group-label": "Label for the reference group input", "cite-ve-dialog-reference-options-group-placeholder": "Placeholder for the reference group input", diff --git a/modules/ve-cite/ve.dm.MWReferenceNode.js b/modules/ve-cite/ve.dm.MWReferenceNode.js index 82543e7..08586c0 100644 --- a/modules/ve-cite/ve.dm.MWReferenceNode.js +++ b/modules/ve-cite/ve.dm.MWReferenceNode.js @@ -308,6 +308,21 @@ return clone; }; +ve.dm.MWReferenceNode.static.describeChange = function ( key, change ) { + if ( key === 'refGroup' ) { + if ( change.from ) { + if ( change.to ) { + return ve.msg( 'cite-ve-changedesc-reflist-group-both', change.from, change.to ); + } else { + return ve.msg( 'cite-ve-changedesc-reflist-group-from', change.from ); + } + } + return ve.msg( 'cite-ve-changedesc-reflist-group-to', change.to ); + } + + return null; +}; + /* Methods */ /** diff --git a/modules/ve-cite/ve.dm.MWReferencesListNode.js b/modules/ve-cite/ve.dm.MWReferencesListNode.js index b5d7e21..e1235c9 100644 --- a/modules/ve-cite/ve.dm.MWReferencesListNode.js +++ b/modules/ve-cite/ve.dm.MWReferencesListNode.js @@ -123,12 +123,19 @@ return els; }; -ve.dm.MWReferencesListNode.static.describeChange = function ( key ) { - if ( key === 'originalMw' ) { - return null; +ve.dm.MWReferencesListNode.static.describeChange = function ( key, change ) { + if ( key === 'refGroup' ) { + if ( change.from ) { + if ( change.to ) { + return ve.msg( 'cite-ve-changedesc-ref-group-both', change.from, change.to ); + } else { + return ve.msg( 'cite-ve-changedesc-ref-group-from', change.from ); + } + } + return ve.msg( 'cite-ve-changedesc-ref-group-to', change.to ); } - // Parent method - return ve.dm.MWReferencesListNode.super.static.describeChange.apply( this, arguments ); + + return null; }; /* Registration */ -- To view, visit https://gerrit.wikimedia.org/r/343134 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifccafdf08704f67027dae2703ff2ded809fb6ab7 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Cite Gerrit-Branch: master Gerrit-Owner: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: Tchanders <thalia.e.c...@googlemail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits