"rules": {
"quote-props": [ "error", "as-needed" ],
"max-len": "off",
- "jquery/no-global-selector": "off"
+ "no-jquery/no-global-selector": "off"
}
}
.show()
.on( 'click', function () {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$( this ).closest( '.config-help-field-container' ).find( '.config-help-field-data' )
.slideToggle( 'fast' );
} );
$wrapper = $( document.getElementById( $checked.attr( 'rel' ) ) );
if ( $wrapper.is( ':hidden' ) ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$( '.dbWrapper' ).hide( 'slow' );
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.show( 'slow' );
}
} );
var $wrapper = $( '#config-cc-wrapper' );
if ( $( '#config__LicenseCode_cc-choose' ).is( ':checked' ) ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.show( 'slow' );
} else {
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.hide( 'slow' );
}
} );
var $wrapper = $( '#' + $( this ).attr( 'rel' ) );
if ( $( this ).is( ':checked' ) ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.show( 'slow' );
} else {
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.hide( 'slow' );
}
} );
var $wrapper = $( '#' + $( this ).attr( 'rel' ) );
if ( $( this ).is( ':checked' ) ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.hide( 'slow' );
} else {
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$wrapper.show( 'slow' );
}
} );
// FIXME: Ugh, this is ugly
if ( $( this ).val() === 'other' ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$textbox.prop( 'readonly', false ).closest( '.config-block' ).slideDown( 'fast' );
} else {
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' );
}
} );
var $memc = $( '#config-memcachewrapper' );
if ( $( 'input[name$="config__MainCacheType"]:checked' ).val() === 'memcached' ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$memc.show( 'slow' );
} else {
- // eslint-disable-next-line jquery/no-animate-toggle
+ // eslint-disable-next-line no-jquery/no-animate-toggle
$memc.hide( 'slow' );
}
} );
"selenium-test": "wdio ./tests/selenium/wdio.conf.js"
},
"devDependencies": {
- "eslint-config-wikimedia": "0.10.1",
+ "eslint-config-wikimedia": "0.11.0",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-copy": "1.0.0",
// Loop through all the dom cells of the thead
$tableRows.each( function ( rowIndex, row ) {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( row.cells, function ( columnIndex, cell ) {
var matrixRowIndex,
matrixColumnIndex;
function convertSortList( sortObjects ) {
var sortList = [];
sortObjects.forEach( function ( sortObject ) {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( sortObject, function ( columnIndex, order ) {
var orderIndex = ( order === 'desc' ) ? 1 : 0;
sortList.push( [ parseInt( columnIndex, 10 ), orderIndex ] );
*/
getQueryString: function () {
var args = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.query, function ( key, val ) {
var k = Uri.encode( key ),
vals = Array.isArray( val ) ? val : [ val ];
// Can't use fadeTo because it calls show(), and we might want to keep some elements hidden
// (e.g. empty #catlinks)
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate
+ // eslint-disable-next-line no-jquery/no-animate
$copyElements.animate( { opacity: 0.4 }, 'fast' );
api = new mw.Api();
}
newList = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( response.parse.indicators, function ( name, indicator ) {
newList.push(
$( '<div>' )
} ).always( function () {
$spinner.hide();
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-animate
+ // eslint-disable-next-line no-jquery/no-animate
$copyElements.animate( {
opacity: 1
}, 'fast' );
$a = $( '#ca-edit a' );
// Not every page has an edit link (T59713)
if ( $a.length ) {
- // eslint-disable-next-line jquery/no-event-shorthand
+ // eslint-disable-next-line no-jquery/no-event-shorthand
$a.get( 0 ).click();
}
}
if ( e.target.nodeName.toLowerCase() !== 'a' ) {
// Trigger native HTMLElement click instead of opening URL (T45052)
e.preventDefault();
- // eslint-disable-next-line jquery/no-event-shorthand
+ // eslint-disable-next-line no-jquery/no-event-shorthand
$edit.get( 0 ).click();
}
} );
// Pre-populate with fake ajax promises to save http requests for tokens
// we already have on the page via the user.tokens module (T36733).
promises[ defaultOptions.ajax.url ] = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( mw.user.tokens.get(), function ( key, value ) {
// This requires #getToken to use the same key as user.tokens.
// Format: token-type + "Token" (eg. csrfToken, patrolToken, watchToken).
file.name = 'file';
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( data, function ( key, val ) {
$form.append( getHiddenInput( key, val ) );
} );
// Hide the current pane
if ( requestedPaneId === currentPaneId ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$currentPane.slideUp( updateHov );
debug.$container.data( 'currentPane', null );
return;
if ( currentPaneId === undefined || currentPaneId === null ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$requestedPane.slideDown( updateHov );
} else {
$currentPane.hide();
if ( errors.length === 0 ) {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$errorBox.slideUp( function () {
$errorBox
.removeAttr( 'class' )
.detach();
}
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$errorBox
.attr( 'class', 'error' )
.empty()
.slideDown();
};
if ( $oldErrorBox !== $errorBox && $oldErrorBox.hasClass( 'error' ) ) {
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$oldErrorBox.slideUp( showFunc );
} else {
showFunc();
style.textContent = css;
document.body.appendChild( style );
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( style.sheet.cssRules, function ( index, rule ) {
selectors.total++;
// document.querySelector() on prefixed pseudo-elements can throw exceptions
mw.jqueryMsg.HtmlEmitter = function ( language, magic ) {
var jmsg = this;
this.language = language;
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( magic, function ( key, val ) {
jmsg[ key.toLowerCase() ] = function () {
return val;
// typeof returns object for arrays
case 'object':
// node is an array of nodes
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
subnodes = $.map( node.slice( 1 ), function ( n ) {
return jmsg.emit( n, replacements );
} );
*/
concat: function ( nodes ) {
var $span = $( '<span>' ).addClass( 'mediaWiki_htmlEmitter' );
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( nodes, function ( i, node ) {
// Let jQuery append nodes, arrays of nodes and jQuery objects
// other things (strings, numbers, ..) are appended as text nodes (not as HTML strings)
}
// Remove explicit plural forms from the forms. They were set undefined in the above loop.
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
forms = $.map( forms, function ( form ) {
return form;
} );
* @return {boolean}
*/
matchAttribute: function ( objects, attrName ) {
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
return $.map( objects, function ( object ) {
return object[ attrName ];
} ).filter( function ( item, index, a ) {
notif.$notification.remove();
} else {
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
notif.$notification.slideUp( 'fast', function () {
$( this ).remove();
} );
// Prepare views
if ( namespaceStructure ) {
items = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( namespaceStructure, function ( namespaceID, label ) {
// Build and clean up the individual namespace items definition
items.push( {
// Before we do anything, we need to see if we require additional items in the
// groups that have 'AllowArbitrary'. For the moment, those are only single_option
// groups; if we ever expand it, this might need further generalization:
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( views, function ( viewName, viewData ) {
viewData.groups.forEach( function ( groupData ) {
var extraValues = [];
*/
Controller.prototype.updateNumericPreference = function ( prefName, newValue ) {
// FIXME: $.isNumeric is deprecated
- // eslint-disable-next-line jquery/no-is-numeric
+ // eslint-disable-next-line no-jquery/no-is-numeric
if ( !$.isNumeric( newValue ) ) {
return;
}
// Check for filters that should be initially selected by their default value
if ( this.isSticky() ) {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.defaultFilters, function ( filterName, filterValue ) {
model.getItemByName( filterName ).toggleSelected( filterValue );
} );
selected = [];
// Find if any are selected
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( filters, function ( name, value ) {
if ( value ) {
selected.push( name );
// all false
// Go over the items and define the correct values
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( filterRepresentation, function ( name, value ) {
// We must store all parameter values as strings '0' or '1'
if ( model.getType() === 'send_unselected_if_any' ) {
} else if ( this.getType() === 'string_options' ) {
values = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( filterRepresentation, function ( name, value ) {
// Collect values
if ( value ) {
}
} );
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( expandedParams, function ( paramName, paramValue ) {
var filterItem = paramToFilterMap[ paramName ];
key = key || 'contextDescription';
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( conflicts, function ( filterName, conflict ) {
if ( !conflict.item.isSelected() ) {
return;
filterItemGroup = filterItem.getGroupModel();
// For each item, see if that item is still conflicting
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( model.groups, function ( groupName, groupModel ) {
if ( filterItem.getGroupName() === groupName ) {
// Check inside the group
expandConflictDefinitions = function ( obj ) {
var result = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( obj, function ( key, conflicts ) {
var filterName,
adjustedConflicts = {};
}, views );
// Go over all views
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( allViews, function ( viewName, viewData ) {
// Define the view
model.views[ viewName ] = {
filterConflictResult = expandConflictDefinitions( filterConflictMap );
// Set conflicts for groups
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( groupConflictResult, function ( group, conflicts ) {
model.groups[ group ].setConflicts( conflicts );
} );
// Set conflicts for items
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( filterConflictResult, function ( filterName, conflicts ) {
var filterItem = model.getItemByName( filterName );
// set conflicts for items in the group
} );
// Create a map between known parameters and their models
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.groups, function ( group, groupModel ) {
if (
groupModel.getType() === 'send_unselected_if_any' ||
var filtersValue;
// For arbitrary numeric single_option values make sure the values
// are normalized to fit within the limits
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.getFilterGroups(), function ( groupName, groupModel ) {
params[ groupName ] = groupModel.normalizeArbitraryValue( params[ groupName ] );
} );
parameters = parameters ? $.extend( true, {}, parameters ) : this.getCurrentParameterState();
// Params
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.getEmptyParameterState(), function ( param, value ) {
if ( parameters[ param ] !== undefined && parameters[ param ] !== value ) {
result[ param ] = parameters[ param ];
view = view || this.getCurrentView();
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.groups, function ( groupName, groupModel ) {
if ( groupModel.getView() === view ) {
result[ groupName ] = groupModel;
groups = this.getFilterGroupsByView( view );
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( groups, function ( groupName, groupModel ) {
result = result.concat( groupModel.getItems() );
} );
var result = {};
// Get default filter state
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.groups, function ( name, model ) {
if ( !model.isSticky() ) {
$.extend( true, result, model.getDefaultParams() );
FiltersViewModel.prototype.getStickyParams = function () {
var result = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.groups, function ( name, model ) {
if ( model.isSticky() ) {
if ( model.isPerGroupRequestParameter() ) {
FiltersViewModel.prototype.getStickyParamsValues = function () {
var result = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.groups, function ( name, model ) {
if ( model.isSticky() ) {
$.extend( true, result, model.getParamRepresentation() );
} );
}
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( groupItems, function ( group, model ) {
$.extend(
result,
// },
// group2: "param4|param5"
// }
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( params, function ( paramName, paramValue ) {
var groupName,
itemOrGroup = model.parameterMap[ paramName ];
// Go over all groups, so we make sure we get the complete output
// even if the parameters don't include a certain group
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.groups, function ( groupName, groupModel ) {
result = $.extend( true, {}, result, groupModel.getFilterRepresentation( groupMap[ groupName ] ) );
} );
FiltersViewModel.prototype.findSelectedItems = function () {
var allSelected = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.getFilterGroups(), function ( groupName, groupModel ) {
allSelected = allSelected.concat( groupModel.findSelectedItems() );
} );
FiltersViewModel.prototype.getViewByTrigger = function ( trigger ) {
var result = 'default';
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.views, function ( name, data ) {
if ( data.trigger === trigger ) {
result = name;
visibleGroupNames = Object.keys( visibleGroups );
// Update visibility of items and groups
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.getFilterGroups(), function ( groupName, groupModel ) {
// Check if the group is visible at all
groupModel.toggleVisible( visibleGroupNames.indexOf( groupName ) !== -1 );
// }
// }
// }
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( savedQueries.queries || {}, function ( id, obj ) {
if ( obj.data && obj.data.filters ) {
obj.data = model.convertToParameters( obj.data );
}
// Initialize the query items
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( savedQueries.queries || {}, function ( id, obj ) {
var normalizedData = obj.data,
isDefault = String( savedQueries.default ) === String( id );
// Highlights: appending _color to keys
newData.highlights = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( data.highlights, function ( highlightedFilterName, value ) {
if ( value ) {
newData.highlights[ highlightedFilterName + '_color' ] = data.highlights[ highlightedFilterName ];
data = this.filtersModel.getMinimizedParamRepresentation( fulldata );
// Split highlight/params
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( data, function ( param, value ) {
if ( param !== 'highlight' && highlightParamNames.indexOf( param ) > -1 ) {
normalizedData.highlights[ param ] = value;
}
// FIXME: Use CSS transition
- // eslint-disable-next-line jquery/no-fade
+ // eslint-disable-next-line no-jquery/no-fade
$newChanges
.hide()
.fadeIn( 1000 );
)
)
) {
- // eslint-disable-next-line jquery/no-animate
$( container ).animate( {
scrollTop: newScrollTop
} );
if ( config.events ) {
// Aggregate events
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( config.events, function ( eventName, eventEmit ) {
aggregate[ eventName ] = eventEmit;
} );
this.$overlay.append( this.highlightPopup.$element );
// Count groups per view
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( groups, function ( groupName, groupModel ) {
if ( !groupModel.isHidden() ) {
viewGroupCount[ groupModel.getView() ] = viewGroupCount[ groupModel.getView() ] || 0;
}
} );
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( groups, function ( groupName, groupModel ) {
var currentItems = [],
view = groupModel.getView();
* Add search suggestions to the search form.
*/
( function () {
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
var searchNS = $.map( mw.config.get( 'wgFormattedNamespaces' ), function ( nsName, nsID ) {
if ( nsID >= 0 && mw.user.options.get( 'searchNs' + nsID ) ) {
// Cast string key to number
break;
case 'namespace':
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
items = $.map( mw.config.get( 'wgFormattedNamespaces' ), function ( name, ns ) {
if ( ns === '0' ) {
name = mw.message( 'blanknamespace' ).text();
}
toRemove = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.templatedItemsCache, function ( k, el ) {
if ( el.widget.isElementAttached() ) {
toRemove[ k ] = el;
}
} else {
newVars = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( p.vars, function ( k, v ) {
newVars[ k ] = v.replace( placeholder, value );
} );
};
while ( toProcess.length ) {
p = toProcess.shift();
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( p.vars, doProcess );
}
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
toRemove = $.map( toRemove, function ( el, name ) {
delete that.widgets[ name ];
return [ el.widgetField, el.helpField ];
if ( this.paramInfo === null ) {
return [];
} else {
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
promises = $.map( this.widgets, function ( widget ) {
return widget.apiCheckValid();
} );
if ( this.paramInfo === null ) {
this.loadFromQueryParams = params;
} else {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.widgets, function ( name, widget ) {
var v = Object.prototype.hasOwnProperty.call( params, name ) ? params[ name ] : undefined;
widget.setApiValue( v );
* @param {Object} displayParams Write query parameters for display into this object
*/
ApiSandbox.PageLayout.prototype.getQueryParams = function ( params, displayParams ) {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.widgets, function ( name, widget ) {
var value = widget.getApiValue();
if ( value !== undefined ) {
*/
ApiSandbox.PageLayout.prototype.getSubpages = function () {
var ret = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.widgets, function ( name, widget ) {
var submodules, i;
if ( typeof widget.getSubmodules === 'function' ) {
render: function ( data, partialTemplates ) {
var partials = {};
if ( partialTemplates ) {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( partialTemplates, function ( name, template ) {
partials[ name ] = template.getSource();
} );
function toggleToc() {
if ( $tocList.is( ':hidden' ) ) {
// FIXME: Use CSS transitions
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$tocList.slideDown( 'fast' );
$tocToggleLink.text( mw.msg( 'hidetoc' ) );
$this.removeClass( 'tochidden' );
mw.cookie.set( 'hidetoc', null );
} else {
- // eslint-disable-next-line jquery/no-slide
+ // eslint-disable-next-line no-jquery/no-slide
$tocList.slideUp( 'fast' );
$tocToggleLink.text( mw.msg( 'showtoc' ) );
$this.addClass( 'tochidden' );
parseValue: this.parseSpecValue
};
spec.size = Math.max.apply(
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
null, $.map( spec.values, function ( v ) { return v.length; } )
);
return spec;
} else {
maxlength = spec.size;
if ( spec.intercalarySize ) {
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( spec.intercalarySize, reduceFunc );
}
$field = $( '<input>' ).attr( 'type', 'text' )
}
if ( spec.values ) {
spec.size = Math.max.apply(
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
null, $.map( spec.values, function ( v ) { return v.length; } )
);
}
if ( config.fullMonthNames && !config.shortMonthNames ) {
config.shortMonthNames = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( config.fullMonthNames, function ( k, v ) {
config.shortMonthNames[ k ] = v.substr( 0, 3 );
} );
}
if ( config.shortDayNames && !config.dayLetters ) {
config.dayLetters = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( config.shortDayNames, function ( k, v ) {
config.dayLetters[ k ] = v.substr( 0, 1 );
} );
}
if ( config.fullDayNames && !config.dayLetters ) {
config.dayLetters = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( config.fullDayNames, function ( k, v ) {
config.dayLetters[ k ] = v.substr( 0, 1 );
} );
}
if ( config.fullDayNames && !config.shortDayNames ) {
config.shortDayNames = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( config.fullDayNames, function ( k, v ) {
config.shortDayNames[ k ] = v.substr( 0, 3 );
} );
if ( this.fullMonthNames && !this.shortMonthNames ) {
this.shortMonthNames = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.fullMonthNames, function ( k, v ) {
this.shortMonthNames[ k ] = v.substr( 0, 3 );
}.bind( this ) );
}
if ( this.shortDayNames && !this.dayLetters ) {
this.dayLetters = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.shortDayNames, function ( k, v ) {
this.dayLetters[ k ] = v.substr( 0, 1 );
}.bind( this ) );
}
if ( this.fullDayNames && !this.dayLetters ) {
this.dayLetters = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.fullDayNames, function ( k, v ) {
this.dayLetters[ k ] = v.substr( 0, 1 );
}.bind( this ) );
}
if ( this.fullDayNames && !this.shortDayNames ) {
this.shortDayNames = {};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.fullDayNames, function ( k, v ) {
this.shortDayNames[ k ] = v.substr( 0, 3 );
}.bind( this ) );
}
if ( !this.dayLetters ) {
this.dayLetters = [];
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.shortDayNames, function ( k, v ) {
this.dayLetters[ k ] = v.substr( 0, 1 );
}.bind( this ) );
spec.parseValue = this.parseSpecValue;
if ( spec.values ) {
spec.size = Math.max.apply(
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
null, $.map( spec.values, function ( v ) { return v.length; } )
);
}
$headRow.append( $( '<td>' ).text( '\u00A0' ) );
// Iterate over the columns object (ignore the value)
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.columns, function ( columnLabel ) {
$headRow.append( $( '<th>' ).html( columnLabel ) );
} );
$thead.append( $headRow );
// Build table
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.rows, function ( rowLabel, rowTag ) {
var $row = $( '<tr>' ),
labelField = new OO.ui.FieldLayout(
$row.append( $( '<td>' ).append( labelField.$element ) );
// Columns
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( widget.columns, function ( columnLabel, columnTag ) {
var thisTag = columnTag + '-' + rowTag,
checkbox = new OO.ui.CheckboxInputWidget( {
// setDisabled sometimes gets called before the widget is ready
if ( this.checkboxes && Object.keys( this.checkboxes ).length > 0 ) {
// Propagate to all checkboxes and update their disabled state
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( this.checkboxes, function ( name, checkbox ) {
checkbox.setDisabled( widget.isTagDisabled( name ) );
} );
exclude = config.exclude || [],
mainNamespace = mw.config.get( 'wgNamespaceIds' )[ '' ];
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
options = $.map( mw.config.get( 'wgFormattedNamespaces' ), function ( name, ns ) {
if ( ns < mainNamespace || exclude.indexOf( Number( ns ) ) !== -1 ) {
return null; // skip
urls = data.data[ 3 ],
self = this;
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( titles, function ( i, result ) {
items.push( new mw.widgets.TitleOptionWidget(
self.getOptionWidgetData(
"valid-jsdoc": "off",
"qunit/require-expect": "off",
"qunit/resolve-async": "off",
- "jquery/no-parse-html-literal": "off"
+ "no-jquery/no-parse-html-literal": "off"
}
}
// Check for incomplete animations/requests/etc and throw if there are any.
if ( $.timers && $.timers.length !== 0 ) {
timers = $.timers.length;
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( $.timers, function ( i, timer ) {
var node = timer.elem;
mw.log.warn( 'Unfinished animation #' + i + ' in ' + timer.queue + ' queue on ' +
var altPromises = [];
// When we have ES6 support we'll be able to use Array.from here
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( arguments, function ( i, arg ) {
var alt = $.Deferred();
altPromises.push( alt );
var done = assert.async(),
$canvas = $( '<div>' ).css( 'background-color', '#fff' ).appendTo( '#qunit-fixture' );
- // eslint-disable-next-line jquery/no-animate
+ // eslint-disable-next-line no-jquery/no-animate
$canvas.animate( { 'background-color': '#000' }, 3 ).promise()
.done( function () {
var endColors = $.colorUtil.getRGB( $canvas.css( 'background-color' ) );
} );
}
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( pluralTestcases, function ( langCode, tests ) {
if ( langCode === mw.config.get( 'wgUserLanguage' ) ) {
pluralTest( langCode, tests );
]
};
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( grammarTests, function ( langCode, test ) {
if ( langCode === mw.config.get( 'wgUserLanguage' ) ) {
grammarTest( langCode, test );
QUnit.test( 'wikiUrlencode', function ( assert ) {
assert.strictEqual( util.wikiUrlencode( 'Test:A & B/Here' ), 'Test:A_%26_B/Here' );
// See also wfUrlencodeTest.php#provideURLS
- // eslint-disable-next-line jquery/no-each-util
+ // eslint-disable-next-line no-jquery/no-each-util
$.each( {
'+': '%2B',
'&': '%26',