From: jenkins-bot Date: Thu, 17 Aug 2017 05:56:42 +0000 (+0000) Subject: Merge "RCFilters: Add marker between old and new changes in enhanced mode" X-Git-Tag: 1.31.0-rc.0~2380 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=72e689e843b839a2eb5d5382301449c69c7e0587;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "RCFilters: Add marker between old and new changes in enhanced mode" --- 72e689e843b839a2eb5d5382301449c69c7e0587 diff --combined includes/changes/EnhancedChangesList.php index def6457ebf,be488feed4..21a811ee8a --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@@ -91,7 -91,7 +91,7 @@@ class EnhancedChangesList extends Chang /** * Format a line for enhanced recentchange (aka with javascript and block of lines). * - * @param RecentChange $rc + * @param RecentChange &$rc * @param bool $watched * @param int $linenumber (default null) * @@@ -172,14 -172,12 +172,14 @@@ $recentChangesFlags = $this->getConfig()->get( 'RecentChangesFlags' ); # Add the namespace and title of the block as part of the class - $tableClasses = [ 'mw-collapsible', 'mw-collapsed', 'mw-enhanced-rc' ]; + $tableClasses = [ 'mw-collapsible', 'mw-collapsed', 'mw-enhanced-rc', 'mw-changeslist-line' ]; if ( $block[0]->mAttribs['rc_log_type'] ) { # Log entry + $tableClasses[] = 'mw-changeslist-log'; $tableClasses[] = Sanitizer::escapeClass( 'mw-changeslist-log-' . $block[0]->mAttribs['rc_log_type'] ); } else { + $tableClasses[] = 'mw-changeslist-edit'; $tableClasses[] = Sanitizer::escapeClass( 'mw-changeslist-ns' . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] ); } @@@ -332,11 -330,6 +332,11 @@@ implode( $this->message['semicolon-separator'], $users ) )->escaped(); + $prefix = ''; + if ( is_callable( $this->changeLinePrefixer ) ) { + $prefix = call_user_func( $this->changeLinePrefixer, $block[0], $this, true ); + } + $templateParams = [ 'articleLink' => $articleLink, 'charDifference' => $charDifference, @@@ -345,10 -338,10 +345,11 @@@ 'lines' => $lines, 'logText' => $logText, 'numberofWatchingusers' => $numberofWatchingusers, + 'prefix' => $prefix, 'rev-deleted-event' => $revDeletedMsg, 'tableClasses' => $tableClasses, 'timestamp' => $block[0]->timestamp, + 'fullTimestamp' => $block[0]->getAttribute( 'rc_timestamp' ), 'users' => $usersList, ]; @@@ -374,7 -367,7 +375,7 @@@ $type = $rcObj->mAttribs['rc_type']; $data = []; - $lineParams = []; + $lineParams = [ 'targetTitle' => $rcObj->getTitle() ]; $classes = [ 'mw-enhanced-rc' ]; if ( $rcObj->watched @@@ -617,10 -610,8 +618,10 @@@ if ( $logType ) { # Log entry + $classes[] = 'mw-changeslist-log'; $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-' . $logType ); } else { + $classes[] = 'mw-changeslist-edit'; $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns' . $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] ); } @@@ -700,15 -691,8 +701,15 @@@ return $key === 'class' || Sanitizer::isReservedDataAttribute( $key ); } ); + $prefix = ''; + if ( is_callable( $this->changeLinePrefixer ) ) { + $prefix = call_user_func( $this->changeLinePrefixer, $rcObj, $this, false ); + } + $line = Html::openElement( 'table', $attribs ) . Html::openElement( 'tr' ); - $line .= ''; + $line .= Html::rawElement( 'td', [], '' ); + $line .= Html::rawElement( 'td', [ 'class' => 'mw-changeslist-line-prefix' ], $prefix ); + $line .= ''; if ( isset( $data['recentChangesFlags'] ) ) { $line .= $this->recentChangesFlags( $data['recentChangesFlags'] ); @@@ -719,12 -703,7 +720,12 @@@ $line .= ' ' . $data['timestampLink']; unset( $data['timestampLink'] ); } - $line .= ' '; + $line .= ' '; + $line .= Html::openElement( 'td', [ + 'class' => 'mw-changeslist-line-inner', + // Used for reliable determination of the affiliated page + 'data-target-page' => $rcObj->getTitle(), + ] ); // everything else: makes it easier for extensions to add or remove data $line .= implode( '', $data ); diff --combined includes/templates/EnhancedChangesListGroup.mustache index cd59d6d3df,931eb7a709..6493df8836 --- a/includes/templates/EnhancedChangesListGroup.mustache +++ b/includes/templates/EnhancedChangesListGroup.mustache @@@ -1,11 -1,10 +1,11 @@@ - +
+ - {{# lines }} + -
{{{ prefix }}} {{{ collectedRcFlags }}} {{ timestamp }}  + {{# rev-deleted-event }}{{{ . }}}{{/ rev-deleted-event }} {{{ articleLink }}}{{{ languageDirMark }}}{{{ logText }}} . . @@@ -16,10 -15,9 +16,10 @@@
{{{ recentChangesFlags }}}  + {{# timestampLink }} {{{ . }}} {{/ timestampLink }}