From: Stephane Bisson Date: Wed, 10 Apr 2019 21:28:33 +0000 (-0400) Subject: RCFilters: hygiene X-Git-Tag: 1.34.0-rc.0~2047^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=69130902098fc5506dc98405e80e15f619b85eb7;p=lhc%2Fweb%2Fwiklou.git RCFilters: hygiene Remove unused code, unneeded initialization and fix documentation. Change-Id: I82d7239b9003a82bc30484b01cf29e01c988b0d6 --- diff --git a/resources/src/mediawiki.rcfilters/Controller.js b/resources/src/mediawiki.rcfilters/Controller.js index b6284fb0af..97b73ae2bd 100644 --- a/resources/src/mediawiki.rcfilters/Controller.js +++ b/resources/src/mediawiki.rcfilters/Controller.js @@ -34,7 +34,6 @@ Controller = function MwRcfiltersController( filtersModel, changesListModel, sav this.pollingRate = require( './config.json' ).StructuredChangeFiltersLiveUpdatePollingRate; this.requestCounter = {}; - this.baseFilterState = {}; this.uriProcessor = null; this.initialized = false; this.wereSavedQueriesSaved = false; diff --git a/resources/src/mediawiki.rcfilters/dm/FilterGroup.js b/resources/src/mediawiki.rcfilters/dm/FilterGroup.js index 8bd5eb20b7..d1f700cc1c 100644 --- a/resources/src/mediawiki.rcfilters/dm/FilterGroup.js +++ b/resources/src/mediawiki.rcfilters/dm/FilterGroup.js @@ -362,15 +362,6 @@ FilterGroup.prototype.getDefaultFilters = function () { return this.defaultFilters; }; -/** - * This is for a single_option and string_options group types - * it returns the value of the default - * - * @return {string} Value of the default - */ -FilterGroup.prototype.getDefaulParamValue = function () { - return this.defaultParams[ this.getName() ]; -}; /** * Get the messags defining the 'whats this' popup for this group * @@ -423,21 +414,6 @@ FilterGroup.prototype.setConflicts = function ( conflicts ) { this.conflicts = conflicts; }; -/** - * Set conflicts for each filter item in the group based on the - * given conflict map - * - * @param {Object} conflicts Object representing the conflict map, - * keyed by the item name, where its value is an object for all its conflicts - */ -FilterGroup.prototype.setFilterConflicts = function ( conflicts ) { - this.getItems().forEach( function ( filterItem ) { - if ( conflicts[ filterItem.getName() ] ) { - filterItem.setConflicts( conflicts[ filterItem.getName() ] ); - } - } ); -}; - /** * Check whether this item has a potential conflict with the given item * @@ -871,7 +847,6 @@ FilterGroup.prototype.getView = function () { /** * Get the prefix used for the filter names inside this group. * - * @param {string} [name] Filter name to prefix * @return {string} Group prefix */ FilterGroup.prototype.getNamePrefix = function () { diff --git a/resources/src/mediawiki.rcfilters/dm/FilterItem.js b/resources/src/mediawiki.rcfilters/dm/FilterItem.js index 8725f51c9a..50057af650 100644 --- a/resources/src/mediawiki.rcfilters/dm/FilterItem.js +++ b/resources/src/mediawiki.rcfilters/dm/FilterItem.js @@ -64,11 +64,10 @@ FilterItem.prototype.getState = function () { /** * Get the message for the display area for the currently active conflict * - * @private * @return {string} Conflict result message key */ FilterItem.prototype.getCurrentConflictResultMessage = function () { - var details = {}; + var details; // First look in filter's own conflicts details = this.getConflictDetails( this.getOwnConflicts(), 'globalDescription' ); diff --git a/resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js b/resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js index 07c484bcf1..4b219de1f8 100644 --- a/resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js +++ b/resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js @@ -225,7 +225,7 @@ FiltersViewModel.prototype.getFirstConflictedItem = function () { */ FiltersViewModel.prototype.initializeFilters = function ( filterGroups, views ) { var filterConflictResult, groupConflictResult, - allViews = {}, + allViews, model = this, items = [], groupConflictMap = {}, diff --git a/resources/src/mediawiki.rcfilters/ui/ChangesLimitAndDateButtonWidget.js b/resources/src/mediawiki.rcfilters/ui/ChangesLimitAndDateButtonWidget.js index 4764bd8395..ac5bbae78e 100644 --- a/resources/src/mediawiki.rcfilters/ui/ChangesLimitAndDateButtonWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/ChangesLimitAndDateButtonWidget.js @@ -147,8 +147,6 @@ ChangesLimitAndDateButtonWidget.prototype.onPopupDays = function ( filterName ) /** * Respond to limit choose event - * - * @param {string} filterName Filter name */ ChangesLimitAndDateButtonWidget.prototype.updateButtonLabel = function () { var message, diff --git a/resources/src/mediawiki.rcfilters/ui/ChangesListWrapperWidget.js b/resources/src/mediawiki.rcfilters/ui/ChangesListWrapperWidget.js index 09b802ef89..78cd8f4e62 100644 --- a/resources/src/mediawiki.rcfilters/ui/ChangesListWrapperWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/ChangesListWrapperWidget.js @@ -28,7 +28,6 @@ var ChangesListWrapperWidget = function MwRcfiltersUiChangesListWrapperWidget( this.filtersViewModel = filtersViewModel; this.changesListViewModel = changesListViewModel; this.controller = controller; - this.highlightClasses = null; // Events this.filtersViewModel.connect( this, { @@ -52,22 +51,6 @@ var ChangesListWrapperWidget = function MwRcfiltersUiChangesListWrapperWidget( OO.inheritClass( ChangesListWrapperWidget, OO.ui.Widget ); -/** - * Get all available highlight classes - * - * @return {string[]} An array of available highlight class names - */ -ChangesListWrapperWidget.prototype.getHighlightClasses = function () { - if ( !this.highlightClasses || !this.highlightClasses.length ) { - this.highlightClasses = this.filtersViewModel.getItemsSupportingHighlights() - .map( function ( filterItem ) { - return filterItem.getCssClass(); - } ); - } - - return this.highlightClasses; -}; - /** * Respond to the highlight feature being toggled on and off * diff --git a/resources/src/mediawiki.rcfilters/ui/GroupWidget.js b/resources/src/mediawiki.rcfilters/ui/GroupWidget.js index 6634e30684..12d53bb74b 100644 --- a/resources/src/mediawiki.rcfilters/ui/GroupWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/GroupWidget.js @@ -6,7 +6,7 @@ * * @constructor * @param {Object} [config] Configuration object - * @param {Object} [events] Events to aggregate. The object represent the + * @cfg {Object} [events] Events to aggregate. The object represent the * event name to aggregate and the event value to emit on aggregate for items. */ var GroupWidget = function MwRcfiltersUiViewSwitchWidget( config ) { diff --git a/resources/src/mediawiki.rcfilters/ui/SavedLinksListItemWidget.js b/resources/src/mediawiki.rcfilters/ui/SavedLinksListItemWidget.js index 4057c48015..806b9a3b13 100644 --- a/resources/src/mediawiki.rcfilters/ui/SavedLinksListItemWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/SavedLinksListItemWidget.js @@ -262,7 +262,6 @@ SavedLinksListItemWidget.prototype.onInputChange = function ( value ) { /** * Save the name of the query * - * @param {string} [value] The value to save * @fires edit */ SavedLinksListItemWidget.prototype.save = function () {