RCFilters: set live update button title
Bug: T167743 Change-Id: Iefea4001371921753e0622c195810b080c459968
This commit is contained in:
parent
dbfae05d39
commit
e3460a6666
4 changed files with 24 additions and 3 deletions
|
|
@ -1459,6 +1459,8 @@
|
|||
"rcfilters-view-tags-tooltip": "Filter results using edit tags",
|
||||
"rcfilters-view-return-to-default-tooltip": "Return to main filter menu",
|
||||
"rcfilters-liveupdates-button": "Live updates",
|
||||
"rcfilters-liveupdates-button-title-on": "Turn off live updates",
|
||||
"rcfilters-liveupdates-button-title-off": "Display new changes as they happen",
|
||||
"rcnotefrom": "Below {{PLURAL:$5|is the change|are the changes}} since <strong>$3, $4</strong> (up to <strong>$1</strong> shown).",
|
||||
"rclistfromreset": "Reset date selection",
|
||||
"rclistfrom": "Show new changes starting from $2, $3",
|
||||
|
|
|
|||
|
|
@ -1649,6 +1649,8 @@
|
|||
"rcfilters-view-tags-tooltip": "Tooltip for the button that loads the tags view in [[Special:RecentChanges]]",
|
||||
"rcfilters-view-return-to-default-tooltip": "Tooltip for the button that returns to the default filter view in [[Special:RecentChanges]]",
|
||||
"rcfilters-liveupdates-button": "Label for the button to enable or disable live updates on [[Special:RecentChanges]]",
|
||||
"rcfilters-liveupdates-button-title-on": "Title for the button to enable or disable live updates on [[Special:RecentChanges]] when the feature is ON.",
|
||||
"rcfilters-liveupdates-button-title-off": "Title for the button to enable or disable live updates on [[Special:RecentChanges]] when the feature is OFF.",
|
||||
"rcnotefrom": "This message is displayed at [[Special:RecentChanges]] when viewing recentchanges from some specific time.\n\nThe corresponding message is {{msg-mw|Rclistfrom}}.\n\nParameters:\n* $1 - the maximum number of changes that are displayed\n* $2 - (Optional) a date and time\n* $3 - a date\n* $4 - a time\n* $5 - Number of changes are displayed, for use with PLURAL",
|
||||
"rclistfromreset": "Used on [[Special:RecentChanges]] to reset a selection of a certain date range.",
|
||||
"rclistfrom": "Used on [[Special:RecentChanges]]. Parameters:\n* $1 - (Currently not use) date and time. The date and the time adds to the rclistfrom description.\n* $2 - time. The time adds to the rclistfrom link description (with split of date and time).\n* $3 - date. The date adds to the rclistfrom link description (with split of date and time).\n\nThe corresponding message is {{msg-mw|Rcnotefrom}}.",
|
||||
|
|
|
|||
|
|
@ -1887,6 +1887,8 @@ return [
|
|||
'rcfilters-view-tags-tooltip',
|
||||
'rcfilters-view-return-to-default-tooltip',
|
||||
'rcfilters-liveupdates-button',
|
||||
'rcfilters-liveupdates-button-title-on',
|
||||
'rcfilters-liveupdates-button-title-off',
|
||||
'rcfilters-other-review-tools',
|
||||
'blanknamespace',
|
||||
'namespaces',
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
// Parent
|
||||
mw.rcfilters.ui.LiveUpdateButtonWidget.parent.call( this, $.extend( {
|
||||
icon: 'play',
|
||||
label: mw.message( 'rcfilters-liveupdates-button' ).text()
|
||||
}, config ) );
|
||||
|
||||
|
|
@ -26,6 +25,8 @@
|
|||
this.model.connect( this, { liveUpdateChange: 'onLiveUpdateChange' } );
|
||||
|
||||
this.$element.addClass( 'mw-rcfilters-ui-liveUpdateButtonWidget' );
|
||||
|
||||
this.setState( false );
|
||||
};
|
||||
|
||||
/* Initialization */
|
||||
|
|
@ -41,14 +42,28 @@
|
|||
this.controller.toggleLiveUpdate();
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the button's state and change its appearance
|
||||
*
|
||||
* @param {boolean} enable Whether the 'live update' feature is now on/off
|
||||
*/
|
||||
mw.rcfilters.ui.LiveUpdateButtonWidget.prototype.setState = function ( enable ) {
|
||||
this.setValue( enable );
|
||||
this.setIcon( enable ? 'stop' : 'play' );
|
||||
this.setTitle( mw.message(
|
||||
enable ?
|
||||
'rcfilters-liveupdates-button-title-on' :
|
||||
'rcfilters-liveupdates-button-title-off'
|
||||
).text() );
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond to the 'live update' feature being turned on/off
|
||||
*
|
||||
* @param {boolean} enable Whether the 'live update' feature is now on/off
|
||||
*/
|
||||
mw.rcfilters.ui.LiveUpdateButtonWidget.prototype.onLiveUpdateChange = function ( enable ) {
|
||||
this.setValue( enable );
|
||||
this.setIcon( enable ? 'stop' : 'play' );
|
||||
this.setState( enable );
|
||||
};
|
||||
|
||||
}( mediaWiki ) );
|
||||
|
|
|
|||
Loading…
Reference in a new issue