[ 'class' => 'rclistfrom' ],
$this->makeOptionsLink(
$this->msg( 'rclistfrom' )->plaintextParams( $now, $timenow, $datenow )->parse(),
- [ 'from' => $timestamp ],
+ [ 'from' => $timestamp, 'fromFormatted' => $now ],
$nondefaults
)
);
$lang = $this->getLanguage();
$timestamp = wfTimestampNow();
+ $now = $lang->userTimeAndDate( $timestamp, $user );
$wlInfo = Html::rawElement(
'span',
[
'class' => 'wlinfo',
- 'data-params' => json_encode( [ 'from' => $timestamp ] ),
+ 'data-params' => json_encode( [ 'from' => $timestamp, 'fromFormatted' => $now ] ),
],
$this->msg( 'wlnote' )->numParams( $numRows, round( $opts['days'] * 24 ) )->params(
$lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user )
"rcfilters-savedqueries-already-saved": "These filters are already saved. Change your settings to create a new Saved Filter.",
"rcfilters-restore-default-filters": "Restore default filters",
"rcfilters-clear-all-filters": "Clear all filters",
- "rcfilters-show-new-changes": "View newest changes",
+ "rcfilters-show-new-changes": "View new changes since $1",
"rcfilters-search-placeholder": "Filter changes (use menu or search for filter name)",
"rcfilters-invalid-filter": "Invalid filter",
"rcfilters-empty-filter": "No active filters. All contributions are shown.",
"rcfilters-savedqueries-already-saved": "Title for the popup in [[Special:RecentChanges]] that indicates that current set of filters is already saved. This is for a small popup, please try to use a short string.",
"rcfilters-restore-default-filters": "Label for the button that resets filters to defaults",
"rcfilters-clear-all-filters": "Title for the button that clears all filters",
- "rcfilters-show-new-changes": "Label for the button to show new changes.",
+ "rcfilters-show-new-changes": "Label for the button to show new changes. Parameters:\n* $1 - timestamp from which new changes are available. It indicates that clicking the refresh link will bring changes newer than (or equal to) this timestamp. It is formatted according to the user's date, time and timezone preferences",
"rcfilters-search-placeholder": "Placeholder for the filter search input. The first \"Filter\" is a verb, and the second \"filter\" is a noun.",
"rcfilters-invalid-filter": "A label for an invalid filter.",
"rcfilters-empty-filter": "Placeholder for the filter list when no filters were chosen.",
var data = $fieldset.find( '.rclistfrom > a, .wlinfo' ).data( 'params' );
if ( data && data.from ) {
this.nextFrom = data.from;
+ this.nextFromFormatted = data.fromFormatted;
}
};
return this.nextFrom;
};
+/**
+ * @return {string} The 'from' parameter formatted per the user's datetime format preference
+ */
+ChangesListViewModel.prototype.getNextFromFormatted = function () {
+ return this.nextFromFormatted;
+};
+
/**
* Toggle the 'live update' feature on/off
*
this.showNewChangesLink = new OO.ui.ButtonWidget( {
icon: 'reload',
framed: false,
- label: mw.msg( 'rcfilters-show-new-changes' ),
flags: [ 'progressive' ],
classes: [ 'mw-rcfilters-ui-filterWrapperWidget-showNewChanges' ]
} );
* @param {boolean} newChangesExist Whether new changes exist
*/
FilterWrapperWidget.prototype.onNewChangesExist = function ( newChangesExist ) {
+ if ( newChangesExist ) {
+ this.showNewChangesLink.setLabel(
+ mw.message(
+ 'rcfilters-show-new-changes',
+ this.changesListModel.getNextFromFormatted()
+ ).text()
+ );
+ }
this.showNewChangesLink.toggle( newChangesExist );
};