return result;
};
+ /**
+ * Get a filter representation of all parameters that are marked
+ * as being excluded from saved query.
+ *
+ * @return {Object} Excluded filters values
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.getExcludedFiltersState = function () {
+ var result = {};
+
+ $.each( this.groups, function ( name, model ) {
+ if ( model.isExcludedFromSavedQueries() ) {
+ $.extend( true, result, model.getSelectedState() );
+ }
+ } );
+
+ return result;
+ };
+
/**
* Analyze the groups and their filters and output an object representing
* the state of the parameters they represent.
return result;
};
+ /**
+ * Get an array of currently applied highlight colors
+ *
+ * @return {string[]} Currently applied highlight colors
+ */
+ mw.rcfilters.dm.FiltersViewModel.prototype.getCurrentlyUsedHighlightColors = function () {
+ var result = [];
+
+ this.getHighlightedItems().forEach( function ( filterItem ) {
+ var color = filterItem.getHighlightColor();
+
+ if ( result.indexOf( color ) === -1 ) {
+ result.push( color );
+ }
+ } );
+
+ return result;
+ };
+
/**
* Sanitize value group of a string_option groups type
* Remove duplicates and make sure to only use valid
*/
mw.rcfilters.dm.FiltersViewModel.prototype.emptyAllFilters = function () {
this.getItems().forEach( function ( filterItem ) {
- this.toggleFilterSelected( filterItem.getName(), false );
+ if ( !filterItem.getGroupModel().isSticky() ) {
+ this.toggleFilterSelected( filterItem.getName(), false );
+ }
}.bind( this ) );
};