From 103581ec75d6ba86de5a22bbdd68f3425ebbf4f8 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Wed, 21 Nov 2018 14:55:48 -0800 Subject: [PATCH] ChangesList separates content elements from presentation Special:RecentChanges and Special:Watchlist benefit from this change Bug: T205581 Change-Id: If46d9ed904fdc6f01decbfde12ade0c47e282171 --- includes/changes/ChangesList.php | 16 ++++++++-------- includes/changes/OldChangesList.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index b1dff14924..a39568ba91 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -454,11 +454,9 @@ class ChangesList extends ContextSource { ); } if ( $rc->mAttribs['rc_type'] == RC_CATEGORIZE ) { - $diffhist = $diffLink . $this->message['pipe-separator'] . $this->message['hist']; + $histLink = $this->message['hist']; } else { - $diffhist = $diffLink . $this->message['pipe-separator']; - # History link - $diffhist .= $this->linkRenderer->makeKnownLink( + $histLink = $this->linkRenderer->makeKnownLink( $rc->getTitle(), new HtmlArmor( $this->message['hist'] ), [ 'class' => 'mw-changeslist-history' ], @@ -469,9 +467,11 @@ class ChangesList extends ContextSource { ); } - // @todo FIXME: Hard coded ". .". Is there a message for this? Should there be? - $s .= $this->msg( 'parentheses' )->rawParams( $diffhist )->escaped() . - ' . . '; + $s .= Html::rawElement( 'div', [ 'class' => 'mw-changeslist-links' ], + Html::rawElement( 'span', [], $diffLink ) . + Html::rawElement( 'span', [], $histLink ) + ) . + ' '; } /** @@ -535,7 +535,7 @@ class ChangesList extends ContextSource { htmlspecialchars( $this->getLanguage()->userTime( $rc->mAttribs['rc_timestamp'], $this->getUser() - ) ) . ' . . '; + ) ) . ' '; } /** diff --git a/includes/changes/OldChangesList.php b/includes/changes/OldChangesList.php index a26f5b64af..c15701ba66 100644 --- a/includes/changes/OldChangesList.php +++ b/includes/changes/OldChangesList.php @@ -121,7 +121,7 @@ class OldChangesList extends ChangesList { if ( $this->getConfig()->get( 'RCShowChangedSize' ) ) { $cd = $this->formatCharacterDifference( $rc ); if ( $cd !== '' ) { - $html .= $cd . ' . . '; + $html .= $cd . ' '; } } -- 2.20.1