* https://www.mediawiki.org/wiki/JQuery_Client
*
* Copyright 2010-2015 jquery-client maintainers and other contributors.
* https://www.mediawiki.org/wiki/JQuery_Client
*
* Copyright 2010-2015 jquery-client maintainers and other contributors.
- wildUserAgents = ['Opera', 'Navigator', 'Minefield', 'KHTML', 'Chrome', 'PLAYSTATION 3', 'Iceweasel'],
+ wildUserAgents = [ 'Opera', 'Navigator', 'Minefield', 'KHTML', 'Chrome', 'PLAYSTATION 3', 'Iceweasel' ],
// Translations for conforming user agent strings
userAgentTranslations = [
// Tons of browsers lie about being something they are not
// Translations for conforming user agent strings
userAgentTranslations = [
// Tons of browsers lie about being something they are not
- [/(Firefox|MSIE|KHTML,?\slike\sGecko|Konqueror)/, ''],
+ [ /(Firefox|MSIE|KHTML,?\slike\sGecko|Konqueror)/, '' ],
],
// 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
- layouts = ['gecko', 'konqueror', 'msie', 'trident', 'edge', 'opera', 'webkit'],
+ layouts = [ 'gecko', 'konqueror', 'msie', 'trident', 'edge', 'opera', 'webkit' ],
- layoutTranslations = [ ['konqueror', 'khtml'], ['msie', 'trident'], ['opera', 'presto'] ],
+ layoutTranslations = [ [ 'konqueror', 'khtml' ], [ 'msie', 'trident' ], [ 'opera', 'presto' ] ],
- layoutVersions = ['applewebkit', 'gecko', 'trident', 'edge'],
+ layoutVersions = [ 'applewebkit', 'gecko', 'trident', 'edge' ],
- platforms = ['win', 'wow64', 'mac', 'linux', 'sunos', 'solaris', 'iphone'],
+ platforms = [ 'win', 'wow64', 'mac', 'linux', 'sunos', 'solaris', 'iphone' ],
- platformTranslations = [ ['sunos', 'solaris'], ['wow64', 'win'] ],
+ platformTranslations = [ [ 'sunos', 'solaris' ], [ 'wow64', 'win' ] ],
translate = function ( source, translations ) {
var i;
for ( i = 0; i < translations.length; i++ ) {
translate = function ( source, translations ) {
var i;
for ( i = 0; i < translations.length; i++ ) {
- if ( match = new RegExp( '(' + layoutVersions.join( '|' ) + ')\\\/(\\d+)').exec( ua ) ) {
- layoutversion = parseInt( match[2], 10 );
+ if ( match = new RegExp( '(' + layoutVersions.join( '|' ) + ')\\/(\\d+)' ).exec( ua ) ) {
+ layoutversion = parseInt( match[ 2 ], 10 );
- // And IE 12's different lies about not being IE
- if ( name === 'chrome' && ( match = ua.match( /\bedge\/([0-9\.]*)/ ) ) ) {
- name = 'msie';
- version = match[1];
+ // And MS Edge's lies about being Chrome
+ //
+ // It's different enough from classic IE Trident engine that they do this
+ // to avoid getting caught by MSIE-specific browser sniffing.
+ if ( name === 'chrome' && ( match = ua.match( /\bedge\/([0-9.]*)/ ) ) ) {
+ name = 'edge';
+ version = match[ 1 ];
}
// And Amazon Silk's lies about being Android on mobile or Safari on desktop
if ( match = ua.match( /\bsilk\/([0-9.\-_]*)/ ) ) {
}
// And Amazon Silk's lies about being Android on mobile or Safari on desktop
if ( match = ua.match( /\bsilk\/([0-9.\-_]*)/ ) ) {
* @return {boolean} The current browser is in the support map
*/
test: function ( map, profile, exactMatchOnly ) {
* @return {boolean} The current browser is in the support map
*/
test: function ( map, profile, exactMatchOnly ) {
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';
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';
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'.
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'.