if ImageMagick is used as image scaler ($wgUseImageMagick = true). Uploading
of WebP images still disabled by default. Add $wgFileExtensions[] =
'webp'; to LocalSettings.php to enable uploading of WebP images.
+* Added a new hook 'EnhancedChangesListModifyLineData', to
+ modify the data used to build lines in enhanced recentchanges and watchlist.
==== External libraries ====
* Update es5-shim from v4.0.0 to v4.1.5.
way will issue a deprecation warning.
* The jquery.mwExtension module was deprecated.
-
== Compatibility ==
MediaWiki 1.26 requires PHP 5.3.3 or later. There is experimental support for
== IRC help ==
There's usually someone online in #mediawiki on irc.freenode.net.
-
$code = $lang->getCode();
static $fastCharDiff = array();
if ( !isset( $fastCharDiff[$code] ) ) {
- $fastCharDiff[$code] = $config->get( 'MiserMode' ) || $context->msg( 'rc-change-size' )->plain() === '$1';
+ $fastCharDiff[$code] = $config->get( 'MiserMode' )
+ || $context->msg( 'rc-change-size' )->plain() === '$1';
}
$formattedSize = $lang->formatNum( $szdiff );
}
}
+ /**
+ * @param RecentChange $rc
+ * @return string
+ * @since 1.26
+ */
+ public function getRollback( RecentChange $rc ) {
+ $s = '';
+ $this->insertRollback( $s, $rc );
+ return $s;
+ }
+
/**
* @param string $s
* @param RecentChange $rc
$s .= ' ' . $tagSummary;
}
+ /**
+ * @param RecentChange $rc
+ * @param array $classes
+ * @return string
+ * @since 1.26
+ */
+ public function getTags( RecentChange $rc, array &$classes ) {
+ $s = '';
+ $this->insertTags( $s, $rc, $classes );
+ return $s;
+ }
+
public function insertExtra( &$s, &$rc, &$classes ) {
// Empty, used for subclasses to add anything special.
}
# Classes to apply -- TODO implement
$classes = array();
$type = $rcObj->mAttribs['rc_type'];
+ $data = array();
$trClass = $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched
? ' class="mw-enhanced-watched"' : '';
+ $separator = ' <span class="mw-changeslist-separator">. .</span> ';
- $r .= '<tr' . $trClass . '><td></td><td class="mw-enhanced-rc">';
- $r .= $this->recentChangesFlags( array(
+ $data['recentChangesFlags'] = array(
'newpage' => $type == RC_NEW,
'minor' => $rcObj->mAttribs['rc_minor'],
'unpatrolled' => $rcObj->unpatrolled,
'bot' => $rcObj->mAttribs['rc_bot'],
- ) );
- $r .= ' </td><td class="mw-enhanced-rc-nested"><span class="mw-enhanced-rc-time">';
+ );
$params = $queryParams;
$link = '<span class="history-deleted">' . $link . '</span> ';
}
}
- $r .= $link . '</span>';
+ $data['timestampLink'] = $link;
+ $currentAndLastLinks = '';
if ( !$type == RC_LOG || $type == RC_NEW ) {
- $r .= ' ' . $this->msg( 'parentheses' )->rawParams(
+ $currentAndLastLinks .= ' ' . $this->msg( 'parentheses' )->rawParams(
$rcObj->curlink .
$this->message['pipe-separator'] .
$rcObj->lastlink
)->escaped();
}
- $r .= ' <span class="mw-changeslist-separator">. .</span> ';
+ $data['currentAndLastLinks'] = $currentAndLastLinks;
+ $data['separatorAfterCurrentAndLastLinks'] = $separator;
# Character diff
if ( $RCShowChangedSize ) {
$cd = $this->formatCharacterDifference( $rcObj );
if ( $cd !== '' ) {
- $r .= $cd . ' <span class="mw-changeslist-separator">. .</span> ';
+ $data['characterDiff'] = $cd;
+ $data['separatorAfterCharacterDiff'] = $separator;
}
}
if ( $rcObj->mAttribs['rc_type'] == RC_LOG ) {
- $r .= $this->insertLogEntry( $rcObj );
+ $data['logEntry'] = $this->insertLogEntry( $rcObj );
} else {
# User links
- $r .= $rcObj->userlink;
- $r .= $rcObj->usertalklink;
- $r .= $this->insertComment( $rcObj );
+ $data['userLink'] = $rcObj->userlink;
+ $data['userTalkLink'] = $rcObj->usertalklink;
+ $data['comment'] = $this->insertComment( $rcObj );
}
# Rollback
- $this->insertRollback( $r, $rcObj );
+ $data['rollback'] = $this->getRollback( $rcObj );
+
# Tags
- $this->insertTags( $r, $rcObj, $classes );
+ $data['tags'] = $this->getTags( $rcObj, $classes );
+
+ // give the hook a chance to modify the data
+ Hooks::run( 'EnhancedChangesListModifyLineData',
+ array( $this, &$data, $block, $rcObj ) );
+
+ $line = '<tr' . $trClass . '><td></td><td class="mw-enhanced-rc">';
+ if ( isset( $data['recentChangesFlags'] ) ) {
+ $line .= $this->recentChangesFlags( $data['recentChangesFlags'] );
+ unset( $data['recentChangesFlags'] );
+ }
+ $line .= ' </td><td class="mw-enhanced-rc-nested">';
+
+ if ( isset( $data['timestampLink'] ) ) {
+ $line .= '<span class="mw-enhanced-rc-time">' . $data['timestampLink'] . '</span>';
+ unset( $data['timestampLink'] );
+ }
+
+ // everything else: makes it easier for extensions to add or remove data
+ $line .= implode( '', $data );
+
+ $line .= "</td></tr>\n";
- $r .= "</td></tr>\n";
+ $r .= $line;
}
$r .= "</table>\n";