From: James D. Forrester Date: Sat, 9 Feb 2019 22:42:09 +0000 (-0800) Subject: resources: Update jquery-client from v2.0.1 to v2.0.2 X-Git-Tag: 1.34.0-rc.0~2870^2 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=2ec769193eec7084c49ed4b4de04fbf023cb5d91;p=lhc%2Fweb%2Fwiklou.git resources: Update jquery-client from v2.0.1 to v2.0.2 Bug: T101483 Change-Id: Ib1537cd92d733998818fe28b04ee81bec48a75d3 --- diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index 6152892d5a..dc20ee95cc 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -66,6 +66,7 @@ production. * The deprecated IPSet\IPSet alias was removed, Wikimedia\IPSet must be used instead. * Updated qunitjs from 2.6.2 to 2.9.1. +* Updated jquery-client from 2.0.1 to 2.0.2. ==== Removed external libraries ==== diff --git a/maintenance/resources/foreign-resources.yaml b/maintenance/resources/foreign-resources.yaml index ee74bb3988..7004102dfd 100644 --- a/maintenance/resources/foreign-resources.yaml +++ b/maintenance/resources/foreign-resources.yaml @@ -69,8 +69,8 @@ jquery: jquery.client: type: tar - src: https://registry.npmjs.org/jquery-client/-/jquery-client-2.0.1.tgz - integrity: sha256-tizJojJ55YYdKh67Zj/ho/9IAkDDA2UGKpcNvzn96Zs= + src: https://registry.npmjs.org/jquery-client/-/jquery-client-2.0.2.tgz + integrity: sha256-8c8nBbBykHEMc4I7ksdKJvvw/P7WkaC2X46RTPdz/pw= dest: package/AUTHORS.txt: package/jquery.client.js: diff --git a/resources/lib/jquery.client/AUTHORS.txt b/resources/lib/jquery.client/AUTHORS.txt index 9f186cac1e..1061a7d5a6 100644 --- a/resources/lib/jquery.client/AUTHORS.txt +++ b/resources/lib/jquery.client/AUTHORS.txt @@ -1,9 +1,10 @@ -Trevor Parscal -Timo Tijhof -Roan Kattouw -Derk-Jan Hartman +Alexander Monk Bartosz Dziewoński -Rob Moen +Brion Vibber +Derk-Jan Hartman Ed Sanders -Alex Monk James D. Forrester +Roan Kattouw +Rob Moen +Timo Tijhof +Trevor Parscal diff --git a/resources/lib/jquery.client/jquery.client.js b/resources/lib/jquery.client/jquery.client.js index cfe2d29279..79f6174538 100644 --- a/resources/lib/jquery.client/jquery.client.js +++ b/resources/lib/jquery.client/jquery.client.js @@ -1,8 +1,8 @@ /*! - * jQuery Client v2.0.1 + * jQuery Client v2.0.2 * https://www.mediawiki.org/wiki/JQuery_Client * - * Copyright 2010-2015 jquery-client maintainers and other contributors. + * Copyright 2010-2019 jquery-client maintainers and other contributors. * Released under the MIT license * http://jquery-client.mit-license.org */ @@ -13,7 +13,7 @@ * @class jQuery.client * @singleton */ -( function ( $ ) { +( function () { /** * @private @@ -51,6 +51,7 @@ return profileCache[ nav.userAgent + '|' + nav.platform ]; } + // eslint-disable-next-line vars-on-top var versionNumber, key = nav.userAgent + '|' + nav.platform, @@ -75,16 +76,18 @@ [ 'Minefield', 'Firefox' ], // This helps keep different versions consistent [ 'Navigator', 'Netscape' ], - // This prevents version extraction issues, otherwise translation would happen later + // This prevents version extraction issues, + // otherwise translation would happen later [ 'PLAYSTATION 3', 'PS3' ] ], - // Strings which precede a version number in a user agent string - combined and used as - // match 1 in version detection + // Strings which precede a version number in a user agent string - combined and + // used as match 1 in version detection versionPrefixes = [ 'camino', 'chrome', 'firefox', 'iceweasel', 'netscape', 'netscape6', 'opera', 'version', 'konqueror', 'lynx', 'msie', 'safari', 'ps3', 'android' ], - // Used as matches 2, 3 and 4 in version extraction - 3 is used as actual version number + // Used as matches 2, 3 and 4 in version extraction - 3 is used as actual + // version number versionSuffix = '(\\/|\\;?\\s|)([a-z0-9\\.\\+]*?)(\\;|dev|rel|\\)|\\s|$)', // Names of known browsers names = [ @@ -104,10 +107,7 @@ // Translations for conforming operating system names platformTranslations = [ [ 'sunos', 'solaris' ], [ 'wow64', 'win' ] ], - /** - * Performs multiple replacements on a string - * @ignore - */ + // Performs multiple replacements on a string translate = function ( source, translations ) { var i; for ( i = 0; i < translations.length; i++ ) { @@ -126,28 +126,34 @@ platform = uk, version = x; - if ( match = new RegExp( '(' + wildUserAgents.join( '|' ) + ')' ).exec( ua ) ) { - // Takes a userAgent string and translates given text into something we can more easily work with + if ( ( match = new RegExp( '(' + wildUserAgents.join( '|' ) + ')' ).exec( ua ) ) ) { + // Takes a userAgent string and translates given text into something we can more + // easily work with ua = translate( ua, userAgentTranslations ); } // Everything will be in lowercase from now on ua = ua.toLowerCase(); + // Firefox Mobile: Remove 'Android' identifier so it matches to 'Firefox' instead + if ( ua.match( /android/ ) && ua.match( /firefox/ ) ) { + ua = ua.replace( new RegExp( 'android' + versionSuffix ), '' ); + } + // Extraction - if ( match = new RegExp( '(' + names.join( '|' ) + ')' ).exec( ua ) ) { + if ( ( match = new RegExp( '(' + names.join( '|' ) + ')' ).exec( ua ) ) ) { name = translate( match[ 1 ], nameTranslations ); } - if ( match = new RegExp( '(' + layouts.join( '|' ) + ')' ).exec( ua ) ) { + if ( ( match = new RegExp( '(' + layouts.join( '|' ) + ')' ).exec( ua ) ) ) { layout = translate( match[ 1 ], layoutTranslations ); } - if ( match = new RegExp( '(' + layoutVersions.join( '|' ) + ')\\/(\\d+)' ).exec( ua ) ) { + if ( ( match = new RegExp( '(' + layoutVersions.join( '|' ) + ')\\/(\\d+)' ).exec( ua ) ) ) { layoutversion = parseInt( match[ 2 ], 10 ); } - if ( match = new RegExp( '(' + platforms.join( '|' ) + ')' ).exec( nav.platform.toLowerCase() ) ) { + if ( ( match = new RegExp( '(' + platforms.join( '|' ) + ')' ).exec( nav.platform.toLowerCase() ) ) ) { platform = translate( match[ 1 ], platformTranslations ); } - if ( match = new RegExp( '(' + versionPrefixes.join( '|' ) + ')' + versionSuffix ).exec( ua ) ) { + if ( ( match = new RegExp( '(' + versionPrefixes.join( '|' ) + ')' + versionSuffix ).exec( ua ) ) ) { version = match[ 3 ]; } @@ -191,7 +197,7 @@ layoutversion = parseInt( match[ 1 ], 10 ); } // And Amazon Silk's lies about being Android on mobile or Safari on desktop - if ( match = ua.match( /\bsilk\/([0-9.\-_]*)/ ) ) { + if ( ( match = ua.match( /\bsilk\/([0-9.\-_]*)/ ) ) ) { if ( match[ 1 ] ) { name = 'silk'; version = match[ 1 ]; @@ -201,8 +207,7 @@ versionNumber = parseFloat( version, 10 ) || 0.0; // Caching - - return profileCache[ key ] = { + profileCache[ key ] = { name: name, layout: layout, layoutVersion: layoutversion, @@ -211,6 +216,8 @@ versionBase: ( version !== x ? Math.floor( versionNumber ).toString() : x ), versionNumber: versionNumber }; + + return profileCache[ key ]; }, /** @@ -247,21 +254,20 @@ * * @param {Object} map Browser support map * @param {Object} [profile] A client-profile object - * @param {boolean} [exactMatchOnly=false] Only return true if the browser is matched, otherwise - * returns true if the browser is not found. + * @param {boolean} [exactMatchOnly=false] Only return true if the browser is matched, + * otherwise returns true if the browser is not found. * * @return {boolean} The current browser is in the support map */ test: function ( map, profile, exactMatchOnly ) { - /* eslint-disable no-eval */ - var conditions, dir, i, op, val, j, pieceVersion, pieceVal, compare; profile = $.isPlainObject( profile ) ? profile : $.client.profile(); if ( map.ltr && map.rtl ) { - dir = $( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'; + dir = $( document.body ).is( '.rtl' ) ? 'rtl' : 'ltr'; map = map[ dir ]; } - // Check over each browser condition to determine if we are running in a compatible client + // Check over each browser condition to determine if we are running in a + // compatible client if ( typeof map !== 'object' || map[ profile.name ] === undefined ) { // Not found, return true if exactMatchOnly not set, false otherwise return !exactMatchOnly; @@ -279,8 +285,8 @@ op = conditions[ i ][ 0 ]; val = conditions[ i ][ 1 ]; if ( typeof val === 'string' ) { - // Perform a component-wise comparison of versions, similar to PHP's version_compare - // but simpler. '1.11' is larger than '1.2'. + // Perform a component-wise comparison of versions, similar to + // PHP's version_compare but simpler. '1.11' is larger than '1.2'. pieceVersion = profile.version.toString().split( '.' ); pieceVal = val.split( '.' ); // Extend with zeroes to equal length @@ -302,10 +308,12 @@ } } // compare will be -1, 0 or 1, depending on comparison result + // eslint-disable-next-line no-eval if ( !( eval( String( compare + op + '0' ) ) ) ) { return false; } } else if ( typeof val === 'number' ) { + // eslint-disable-next-line no-eval if ( !( eval( 'profile.versionNumber' + op + val ) ) ) { return false; } @@ -315,4 +323,4 @@ return true; } }; -}( jQuery ) ); +}() );