From: jenkins-bot Date: Wed, 2 Aug 2017 01:19:59 +0000 (+0000) Subject: Merge "RCFilters: Add 'enhanced' view (Group by pages)" X-Git-Tag: 1.31.0-rc.0~2501 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=1f2c768a9df46909932b44443f733d2185517435 Merge "RCFilters: Add 'enhanced' view (Group by pages)" --- 1f2c768a9df46909932b44443f733d2185517435 diff --cc resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js index 79b3d6f1c6,d558e46b63..f07d3f1f59 --- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js +++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js @@@ -900,10 -866,28 +921,30 @@@ // Update the preference for this session mw.user.options.set( 'rcdays', newValue ); } + */ + return; }; + /** + * Update the group by page default value + * + * @param {number} newValue New value + */ + mw.rcfilters.Controller.prototype.updateGroupByPageDefault = function ( newValue ) { + if ( !$.isNumeric( newValue ) ) { + return; + } + + newValue = Number( newValue ); + + if ( mw.user.options.get( 'usenewrc' ) !== newValue ) { + // Save the preference + new mw.Api().saveOption( 'usenewrc', newValue ); + // Update the preference for this session + mw.user.options.set( 'usenewrc', newValue ); + } + }; + /** * Synchronize the URL with the current state of the filters * without adding an history entry.