"rcfilters-hours-title": "Recent hours",
"rcfilters-days-show-days": "$1 {{PLURAL:$1|day|days}}",
"rcfilters-days-show-hours": "$1 {{PLURAL:$1|hour|hours}}",
+ "rcfilters-highlighted-filters-list": "Highlighted: $1",
"rcfilters-quickfilters": "Saved filters",
"rcfilters-quickfilters-placeholder-title": "No links saved yet",
"rcfilters-quickfilters-placeholder-description": "To save your filter settings and reuse them later, click the bookmark icon in the Active Filter area, below.",
"rcfilters-hours-title": "Title for the options to change the number of hours for the results shown.",
"rcfilters-days-show-days": "Title for the button that opens the operation to control the day range for the results. \n\nParameters: $1 - Number of days shown",
"rcfilters-days-show-hours": "Title for the button that opens the operation to control the hour range for the results. \n\nParameters: $1 - Number of hours shown",
+ "rcfilters-highlighted-filters-list": "Text for the tooltip that is displayed over highlighted results, specifying which filters the result matches in [[Special:RecentChanges]] when RCFilters are enabled. \n\nParameters: $1 - A comma separated list of matching filter names.",
"rcfilters-quickfilters": "Label for the button that opens the saved filter settings menu in [[Special:RecentChanges]]",
"rcfilters-quickfilters-placeholder-title": "Title for the text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
"rcfilters-quickfilters-placeholder-description": "Description for the text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
'rcfilters-hours-title',
'rcfilters-days-show-days',
'rcfilters-days-show-hours',
+ 'rcfilters-highlighted-filters-list',
'rcfilters-quickfilters',
'rcfilters-quickfilters-placeholder-title',
'rcfilters-quickfilters-placeholder-description',
}
this.filtersViewModel.getHighlightedItems().forEach( function ( filterItem ) {
+ var $elements = this.$element.find( '.' + filterItem.getCssClass() );
+
// Add highlight class to all highlighted list items
- this.$element.find( '.' + filterItem.getCssClass() )
+ $elements
.addClass( 'mw-rcfilters-highlight-color-' + filterItem.getHighlightColor() );
+
+ $elements.each( function () {
+ var filterString = $( this ).attr( 'data-highlightedFilters' ) || '',
+ filters = filterString ? filterString.split( '|' ) : [];
+
+ if ( filters.indexOf( filterItem.getLabel() ) === -1 ) {
+ filters.push( filterItem.getLabel() );
+ }
+
+ $( this )
+ .attr( 'data-highlightedFilters', filters.join( '|' ) );
+ } );
}.bind( this ) );
+ // Apply a title for relevant filters
+ this.$element.find( '[data-highlightedFilters]' ).each( function () {
+ var filterString = $( this ).attr( 'data-highlightedFilters' ) || '',
+ filters = filterString ? filterString.split( '|' ) : [];
+
+ if ( filterString ) {
+ $( this ).attr( 'title', mw.msg( 'rcfilters-highlighted-filters-list', filters.join( ', ' ) ) );
+ }
+ } );
// Turn on highlights
this.$element.addClass( 'mw-rcfilters-ui-changesListWrapperWidget-highlighted' );
this.$element.find( '.mw-rcfilters-highlight-color-' + color ).removeClass( 'mw-rcfilters-highlight-color-' + color );
}.bind( this ) );
+ this.$element.find( '[data-highlightedFilters]' )
+ .removeAttr( 'title' )
+ .removeAttr( 'data-highlightedFilters' );
// Turn off highlights
this.$element.removeClass( 'mw-rcfilters-ui-changesListWrapperWidget-highlighted' );
};