},
"rules": {
"no-restricted-properties": [
- 1,
+ 2,
{
"object": "$",
"property": "map",
// If the first argument is the function,
// set filterFn to the first argument's value and ignore the second argument.
- if ( $.isFunction( limit ) ) {
+ if ( typeof limit === 'function' ) {
filterFn = limit;
limit = undefined;
// Either way, verify it is a function so we don't have to call
// isFunction again after this.
- } else if ( !filterFn || !$.isFunction( filterFn ) ) {
+ } else if ( !filterFn || typeof filterFn !== 'function' ) {
filterFn = undefined;
}
if ( context.data.timerID !== null ) {
clearTimeout( context.data.timerID );
}
- if ( $.isFunction( context.config.cancel ) ) {
+ if ( typeof context.config.cancel === 'function' ) {
context.config.cancel.call( context.data.$textbox );
}
},
showEventName += '.' + options.namespace;
}
- if ( $.isFunction( options.message ) ) {
+ if ( typeof options.message === 'function' ) {
message = options.message();
} else {
message = options.message;
fetch: function ( val ) {
var $el = $( this );
$el.suggestions( 'suggestions',
- $.grep( $el.data( 'autocomplete' ), function ( v ) {
+ $el.data( 'autocomplete' ).filter( function ( v ) {
return v.indexOf( val ) === 0;
} )
);
var module = mw.loader.moduleRegistry[ moduleName ];
// Grep module's JavaScript
- if ( $.isFunction( module.script ) && pattern.test( module.script.toString() ) ) {
+ if ( typeof module.script === 'function' && pattern.test( module.script.toString() ) ) {
return true;
}
+/* eslint-disable no-restricted-properties */
/*!
* Experimental advanced wikitext parser-emitter.
* See: https://www.mediawiki.org/wiki/Extension:UploadWizard/MessageParser for docs
+/* eslint-disable no-restricted-properties */
( function ( mw, $ ) {
var ProtectionForm,
reasonCodePointLimit = mw.config.get( 'wgCommentCodePointLimit' ),
+/* eslint-disable no-restricted-properties */
/*!
* Add search suggestions to the search form.
*/
+/* eslint-disable no-restricted-properties */
( function ( $, mw, OO ) {
'use strict';
var ApiSandbox, Util, WidgetMethods, Validators,
auprefix: userInput[ 0 ].toUpperCase() + userInput.slice( 1 ),
aulimit: maxRows
} ).done( function ( data ) {
- var users = $.map( data.query.allusers, function ( userObj ) {
+ var users = data.query.allusers.map( function ( userObj ) {
return userObj.name;
} );
response( users );
+/* eslint-disable no-restricted-properties */
( function ( $, mw ) {
/**
+/* eslint-disable no-restricted-properties */
( function ( $, mw ) {
/**
+/* eslint-disable no-restricted-properties */
( function ( $, mw ) {
/**
+/* eslint-disable no-restricted-properties */
/*!
* MediaWiki Widgets - NamespaceInputWidget class.
*
// Workaround T97096 by setting uselang=content
uselang: 'content'
} ).then( function ( data ) {
- return $.map( data.query.interwikimap, function ( interwiki ) {
+ return data.query.interwikimap.map( function ( interwiki ) {
return interwiki.prefix;
} );
} );
QUnit.test( 'Match PHP parser', function ( assert ) {
var tasks;
mw.messages.set( mw.libs.phpParserData.messages );
- tasks = $.map( mw.libs.phpParserData.tests, function ( test ) {
+ tasks = mw.libs.phpParserData.tests.map( function ( test ) {
var done = assert.async();
return function ( next, abort ) {
getMwLanguage( test.lang )
-( function ( mw, $ ) {
+( function ( mw ) {
QUnit.module( 'mediawiki.user', QUnit.newMwEnvironment( {
setup: function () {
this.server = this.sandbox.useFakeServer();
result = mw.user.generateRandomSessionId();
assert.strictEqual( typeof result, 'string', 'type' );
- assert.strictEqual( $.trim( result ), result, 'no whitespace at beginning or end' );
+ assert.strictEqual( result.trim(), result, 'no whitespace at beginning or end' );
assert.strictEqual( result.length, 16, 'size' );
result2 = mw.user.generateRandomSessionId();
result = mw.user.generateRandomSessionId();
assert.strictEqual( typeof result, 'string', 'type' );
- assert.strictEqual( $.trim( result ), result, 'no whitespace at beginning or end' );
+ assert.strictEqual( result.trim(), result, 'no whitespace at beginning or end' );
assert.strictEqual( result.length, 16, 'size' );
result2 = mw.user.generateRandomSessionId();
var result = mw.user.sessionId(),
result2 = mw.user.sessionId();
assert.strictEqual( typeof result, 'string', 'type' );
- assert.strictEqual( $.trim( result ), result, 'no leading or trailing whitespace' );
+ assert.strictEqual( result.trim(), result, 'no leading or trailing whitespace' );
assert.strictEqual( result2, result, 'retained' );
} );
-}( mediaWiki, jQuery ) );
+}( mediaWiki ) );