10 addArrayElementsUnique: function ( arr
, elements
) {
11 elements
= Array
.isArray( elements
) ? elements
: [ elements
];
13 elements
.forEach( function ( element
) {
14 if ( arr
.indexOf( element
) === -1 ) {
21 normalizeParamOptions: function ( givenOptions
, legalOptions
) {
24 if ( givenOptions
.indexOf( 'all' ) > -1 ) {
25 // If anywhere in the values there's 'all', we
26 // treat it as if only 'all' was selected.
27 // Example: param=valid1,valid2,all
32 // Get rid of any dupe and invalid parameter, only output
34 // Example: param=valid1,valid2,invalid1,valid1
35 // Result: param=valid1,valid2
36 givenOptions
.forEach( function ( value
) {
38 legalOptions
.indexOf( value
) > -1 &&
39 result
.indexOf( value
) === -1
49 liveUpdate
: mw
.config
.get( 'wgStructuredChangeFiltersLiveUpdateSupported' ) &&
50 ( mw
.user
.options
.get( 'rcenhancedfilters' ) || new mw
.Uri().query
.liveupdate
)