Add CSS classes for diff/hist links at Enhanced RC
CSS classes mw-changeslist-diff and mw-changeslist-history should be added to diff and history links in recent changes. There is already a patch for the old recent changes page, this one adds the same classes onto the enhanced recent changes page (class EnhancedChangesList). As enhanced RC has a lot more links, this patch introduces two new css classes for some links, one named #mw-changeslist-diff-cur which is for the diff that links to a current version within nested changes and the other named #mw-changeslist-groupdiff which is for the 'summary diff' that appears for a group of nested changes. Follow-up: I2d5ef8c180ae4ff6e7f5d0ab443dc7084f8c4c77 Bug: T157178 Change-Id: Ib51639a92b5925f2bad0aebd4f7068b178f65017
This commit is contained in:
parent
5a7cfcda8b
commit
6a60a90ffb
2 changed files with 10 additions and 8 deletions
|
|
@ -531,7 +531,7 @@ class EnhancedChangesList extends ChangesList {
|
|||
$links['total-changes'] = $this->linkRenderer->makeKnownLink(
|
||||
$block0->getTitle(),
|
||||
new HtmlArmor( $nchanges[$n] ),
|
||||
[],
|
||||
[ 'class' => 'mw-changeslist-groupdiff' ],
|
||||
$queryParams + [
|
||||
'diff' => $currentRevision,
|
||||
'oldid' => $last->mAttribs['rc_last_oldid'],
|
||||
|
|
@ -541,7 +541,7 @@ class EnhancedChangesList extends ChangesList {
|
|||
$links['total-changes-since-last'] = $this->linkRenderer->makeKnownLink(
|
||||
$block0->getTitle(),
|
||||
new HtmlArmor( $sinceLastVisitMsg[$sinceLast] ),
|
||||
[],
|
||||
[ 'class' => 'mw-changeslist-groupdiff' ],
|
||||
$queryParams + [
|
||||
'diff' => $currentRevision,
|
||||
'oldid' => $unvisitedOldid,
|
||||
|
|
@ -563,7 +563,7 @@ class EnhancedChangesList extends ChangesList {
|
|||
$links['history'] = $this->linkRenderer->makeKnownLink(
|
||||
$block0->getTitle(),
|
||||
new HtmlArmor( $this->message['enhancedrc-history'] ),
|
||||
[],
|
||||
[ 'class' => 'mw-changeslist-history' ],
|
||||
$params
|
||||
);
|
||||
}
|
||||
|
|
@ -718,7 +718,7 @@ class EnhancedChangesList extends ChangesList {
|
|||
. $this->linkRenderer->makeKnownLink(
|
||||
$pageTitle,
|
||||
new HtmlArmor( $this->message['hist'] ),
|
||||
[],
|
||||
[ 'class' => 'mw-changeslist-history' ],
|
||||
$query
|
||||
) )->escaped();
|
||||
return $retVal;
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class RCCacheEntryFactory {
|
|||
$curLink = $curMessage;
|
||||
} else {
|
||||
$curUrl = htmlspecialchars( $cacheEntry->getTitle()->getLinkURL( $queryParams ) );
|
||||
$curLink = "<a href=\"$curUrl\">$curMessage</a>";
|
||||
$curLink = "<a class=\"mw-changeslist-diff-cur\" href=\"$curUrl\">$curMessage</a>";
|
||||
}
|
||||
|
||||
return $curLink;
|
||||
|
|
@ -229,16 +229,18 @@ class RCCacheEntryFactory {
|
|||
return $diffMessage;
|
||||
}
|
||||
$diffUrl = htmlspecialchars( $pageTitle->getLinkURL( $queryParams ) );
|
||||
$diffLink = "<a href=\"$diffUrl\">$diffMessage</a>";
|
||||
$diffLink = "<a class=\"mw-changeslist-diff\" href=\"$diffUrl\">$diffMessage</a>";
|
||||
} else {
|
||||
$diffUrl = htmlspecialchars( $cacheEntry->getTitle()->getLinkURL( $queryParams ) );
|
||||
$diffLink = "<a href=\"$diffUrl\">$diffMessage</a>";
|
||||
$diffLink = "<a class=\"mw-changeslist-diff\" href=\"$diffUrl\">$diffMessage</a>";
|
||||
}
|
||||
|
||||
return $diffLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the link to the previous version
|
||||
*
|
||||
* @param RecentChange $cacheEntry
|
||||
* @param bool $showDiffLinks
|
||||
*
|
||||
|
|
@ -257,7 +259,7 @@ class RCCacheEntryFactory {
|
|||
$lastLink = $this->linkRenderer->makeKnownLink(
|
||||
$cacheEntry->getTitle(),
|
||||
new HtmlArmor( $lastMessage ),
|
||||
[],
|
||||
[ 'class' => 'mw-changeslist-diff' ],
|
||||
$this->buildDiffQueryParams( $cacheEntry )
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue