From ed8b563add537b88d4fbc950538f0e9a54305e47 Mon Sep 17 00:00:00 2001 From: Thalia Date: Fri, 11 Aug 2017 19:26:02 -0400 Subject: [PATCH] VisualDiff: Show less information about ref nodes If a ref node is highlighted as changed because its index has changed (e.g. because an earlier reference was inserted or removed), describe this more elegantly. Bug: T170235 Bug: T171377 Change-Id: I2513bb82099a92529516e4e217e61a2d0a2dd43b --- includes/CiteHooks.php | 1 + modules/ve-cite/i18n/en.json | 1 + modules/ve-cite/i18n/qqq.json | 1 + modules/ve-cite/ve.dm.MWReferenceNode.js | 9 +++++---- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/CiteHooks.php b/includes/CiteHooks.php index 1fa414ec0..06bbba1ec 100644 --- a/includes/CiteHooks.php +++ b/includes/CiteHooks.php @@ -160,6 +160,7 @@ class CiteHooks { "cite-ve-changedesc-reflist-group-both", "cite-ve-changedesc-reflist-group-from", "cite-ve-changedesc-reflist-group-to", + "cite-ve-changedesc-reflist-item-id", "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 2f311bb07..5f6e0e856 100644 --- a/modules/ve-cite/i18n/en.json +++ b/modules/ve-cite/i18n/en.json @@ -28,6 +28,7 @@ "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-changedesc-reflist-item-id": "Reference index changed", "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", diff --git a/modules/ve-cite/i18n/qqq.json b/modules/ve-cite/i18n/qqq.json index deaf01333..f993de8e2 100644 --- a/modules/ve-cite/i18n/qqq.json +++ b/modules/ve-cite/i18n/qqq.json @@ -40,6 +40,7 @@ "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-changedesc-reflist-item-id": "Description of the visible index of a reference changing", "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 de55223c7..fa0d6cb03 100644 --- a/modules/ve-cite/ve.dm.MWReferenceNode.js +++ b/modules/ve-cite/ve.dm.MWReferenceNode.js @@ -323,6 +323,9 @@ ve.dm.MWReferenceNode.static.cloneElement = function () { return clone; }; +/** + * @inheritdoc + */ ve.dm.MWReferenceNode.static.describeChange = function ( key, change ) { if ( key === 'refGroup' ) { if ( change.from ) { @@ -334,11 +337,9 @@ ve.dm.MWReferenceNode.static.describeChange = function ( key, change ) { } return ve.msg( 'cite-ve-changedesc-reflist-group-to', change.to ); } - if ( key === 'listGroup' || key === 'originalMw' ) { - return null; + if ( key === 'refListItemId' ) { + return ve.msg( 'cite-ve-changedesc-reflist-item-id' ); } - - return ve.dm.MWReferenceNode.parent.static.describeChange.apply( this, arguments ); }; /* Methods */