resources: Update jquery-client from v2.0.1 to v2.0.2
authorJames D. Forrester <jforrester@wikimedia.org>
Sat, 9 Feb 2019 22:42:09 +0000 (14:42 -0800)
committerJforrester <jforrester@wikimedia.org>
Sat, 9 Feb 2019 23:15:58 +0000 (23:15 +0000)
Bug: T101483
Change-Id: Ib1537cd92d733998818fe28b04ee81bec48a75d3

RELEASE-NOTES-1.33
maintenance/resources/foreign-resources.yaml
resources/lib/jquery.client/AUTHORS.txt
resources/lib/jquery.client/jquery.client.js

index 6152892..dc20ee9 100644 (file)
@@ -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 ====
 
index ee74bb3..7004102 100644 (file)
@@ -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:
index 9f186ca..1061a7d 100644 (file)
@@ -1,9 +1,10 @@
-Trevor Parscal <trevorparscal@gmail.com>
-Timo Tijhof <krinklemail@gmail.com>
-Roan Kattouw <roan.kattouw@gmail.com>
-Derk-Jan Hartman <hartman.wiki@gmail.com>
+Alexander Monk <krenair@gmail.com>
 Bartosz DziewoƄski <matma.rex@gmail.com>
-Rob Moen <rmoen@wikimedia.org>
+Brion Vibber <brion@wikimedia.org>
+Derk-Jan Hartman <hartman@videolan.org>
 Ed Sanders <esanders@wikimedia.org>
-Alex Monk <krenair@gmail.com>
 James D. Forrester <jforrester@wikimedia.org>
+Roan Kattouw <roan.kattouw@gmail.com>
+Rob Moen <rmoen@mediawiki.org>
+Timo Tijhof <krinklemail@gmail.com>
+Trevor Parscal <trevorparscal@gmail.com>
index cfe2d29..79f6174 100644 (file)
@@ -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,
                                        [ '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 = [
                                // 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++ ) {
                                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 ];
                        }
 
                                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 ];
                        versionNumber = parseFloat( version, 10 ) || 0.0;
 
                        // Caching
-
-                       return profileCache[ key ] = {
+                       profileCache[ key ] = {
                                name: name,
                                layout: layout,
                                layoutVersion: layoutversion,
                                versionBase: ( version !== x ? Math.floor( versionNumber ).toString() : x ),
                                versionNumber: versionNumber
                        };
+
+                       return profileCache[ key ];
                },
 
                /**
                 *
                 * @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;
                                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
                                                }
                                        }
                                        // 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;
                                        }
                        return true;
                }
        };
-}( jQuery ) );
+}() );