Merge "Attempt to fix populateIpChanges maintenance script"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / dm / mw.rcfilters.dm.FiltersViewModel.js
index a8ee06b..3b882a6 100644 (file)
                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
                } );
        };
 
-       /**
-        * Check whether the default values of the filters are all false.
-        *
-        * @return {boolean} Default filters are all false
-        */
-       mw.rcfilters.dm.FiltersViewModel.prototype.areDefaultFiltersEmpty = function () {
-               var defaultFilters;
-
-               if ( this.defaultFiltersEmpty !== null ) {
-                       // We only need to do this test once,
-                       // because defaults are set once per session
-                       defaultFilters = this.getFiltersFromParameters( this.getDefaultParams() );
-                       this.defaultFiltersEmpty = Object.keys( defaultFilters ).every( function ( filterName ) {
-                               return !defaultFilters[ filterName ];
-                       } );
-               }
-
-               return this.defaultFiltersEmpty;
-       };
-
        /**
         * Get the item that matches the given name
         *