@pixi/settings
Advanced tools
Comparing version 5.2.1 to 5.2.2
/*! | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* @pixi/settings - v5.2.2 | ||
* Compiled Tue, 21 Apr 2020 03:53:51 UTC | ||
* | ||
@@ -15,2 +15,3 @@ * @pixi/settings is licensed under the MIT License. | ||
var appleTablet = /iPad/i; | ||
var appleUniversal = /\biOS-universal(?:.+)Mac\b/i; | ||
var androidPhone = /\bAndroid(?:.+)Mobile\b/i; | ||
@@ -27,8 +28,36 @@ var androidTablet = /Android/i; | ||
var otherFirefox = /Mobile(?:.+)Firefox\b/i; | ||
function match(regex, userAgent) { | ||
return regex.test(userAgent); | ||
var isAppleTabletOnIos13 = function (navigator) { | ||
return (typeof navigator !== 'undefined' && | ||
navigator.platform === 'MacIntel' && | ||
typeof navigator.maxTouchPoints === 'number' && | ||
navigator.maxTouchPoints > 1 && | ||
typeof MSStream === 'undefined'); | ||
}; | ||
function createMatch(userAgent) { | ||
return function (regex) { return regex.test(userAgent); }; | ||
} | ||
function isMobile(userAgent) { | ||
userAgent = | ||
userAgent || (typeof navigator !== 'undefined' ? navigator.userAgent : ''); | ||
function isMobile(param) { | ||
var nav = { | ||
userAgent: '', | ||
platform: '', | ||
maxTouchPoints: 0 | ||
}; | ||
if (!param && typeof navigator !== 'undefined') { | ||
nav = { | ||
userAgent: navigator.userAgent, | ||
platform: navigator.platform, | ||
maxTouchPoints: navigator.maxTouchPoints || 0 | ||
}; | ||
} | ||
else if (typeof param === 'string') { | ||
nav.userAgent = param; | ||
} | ||
else if (param && param.userAgent) { | ||
nav = { | ||
userAgent: param.userAgent, | ||
platform: param.platform, | ||
maxTouchPoints: param.maxTouchPoints || 0 | ||
}; | ||
} | ||
var userAgent = nav.userAgent; | ||
var tmp = userAgent.split('[FBAN'); | ||
@@ -42,53 +71,57 @@ if (typeof tmp[1] !== 'undefined') { | ||
} | ||
var match = createMatch(userAgent); | ||
var result = { | ||
apple: { | ||
phone: match(appleIphone, userAgent) && !match(windowsPhone, userAgent), | ||
ipod: match(appleIpod, userAgent), | ||
tablet: !match(appleIphone, userAgent) && | ||
match(appleTablet, userAgent) && | ||
!match(windowsPhone, userAgent), | ||
device: (match(appleIphone, userAgent) || | ||
match(appleIpod, userAgent) || | ||
match(appleTablet, userAgent)) && | ||
!match(windowsPhone, userAgent), | ||
phone: match(appleIphone) && !match(windowsPhone), | ||
ipod: match(appleIpod), | ||
tablet: !match(appleIphone) && | ||
(match(appleTablet) || isAppleTabletOnIos13(nav)) && | ||
!match(windowsPhone), | ||
universal: match(appleUniversal), | ||
device: (match(appleIphone) || | ||
match(appleIpod) || | ||
match(appleTablet) || | ||
match(appleUniversal) || | ||
isAppleTabletOnIos13(nav)) && | ||
!match(windowsPhone) | ||
}, | ||
amazon: { | ||
phone: match(amazonPhone, userAgent), | ||
tablet: !match(amazonPhone, userAgent) && match(amazonTablet, userAgent), | ||
device: match(amazonPhone, userAgent) || match(amazonTablet, userAgent), | ||
phone: match(amazonPhone), | ||
tablet: !match(amazonPhone) && match(amazonTablet), | ||
device: match(amazonPhone) || match(amazonTablet) | ||
}, | ||
android: { | ||
phone: (!match(windowsPhone, userAgent) && match(amazonPhone, userAgent)) || | ||
(!match(windowsPhone, userAgent) && match(androidPhone, userAgent)), | ||
tablet: !match(windowsPhone, userAgent) && | ||
!match(amazonPhone, userAgent) && | ||
!match(androidPhone, userAgent) && | ||
(match(amazonTablet, userAgent) || match(androidTablet, userAgent)), | ||
device: (!match(windowsPhone, userAgent) && | ||
(match(amazonPhone, userAgent) || | ||
match(amazonTablet, userAgent) || | ||
match(androidPhone, userAgent) || | ||
match(androidTablet, userAgent))) || | ||
match(/\bokhttp\b/i, userAgent), | ||
phone: (!match(windowsPhone) && match(amazonPhone)) || | ||
(!match(windowsPhone) && match(androidPhone)), | ||
tablet: !match(windowsPhone) && | ||
!match(amazonPhone) && | ||
!match(androidPhone) && | ||
(match(amazonTablet) || match(androidTablet)), | ||
device: (!match(windowsPhone) && | ||
(match(amazonPhone) || | ||
match(amazonTablet) || | ||
match(androidPhone) || | ||
match(androidTablet))) || | ||
match(/\bokhttp\b/i) | ||
}, | ||
windows: { | ||
phone: match(windowsPhone, userAgent), | ||
tablet: match(windowsTablet, userAgent), | ||
device: match(windowsPhone, userAgent) || match(windowsTablet, userAgent), | ||
phone: match(windowsPhone), | ||
tablet: match(windowsTablet), | ||
device: match(windowsPhone) || match(windowsTablet) | ||
}, | ||
other: { | ||
blackberry: match(otherBlackBerry, userAgent), | ||
blackberry10: match(otherBlackBerry10, userAgent), | ||
opera: match(otherOpera, userAgent), | ||
firefox: match(otherFirefox, userAgent), | ||
chrome: match(otherChrome, userAgent), | ||
device: match(otherBlackBerry, userAgent) || | ||
match(otherBlackBerry10, userAgent) || | ||
match(otherOpera, userAgent) || | ||
match(otherFirefox, userAgent) || | ||
match(otherChrome, userAgent), | ||
blackberry: match(otherBlackBerry), | ||
blackberry10: match(otherBlackBerry10), | ||
opera: match(otherOpera), | ||
firefox: match(otherFirefox), | ||
chrome: match(otherChrome), | ||
device: match(otherBlackBerry) || | ||
match(otherBlackBerry10) || | ||
match(otherOpera) || | ||
match(otherFirefox) || | ||
match(otherChrome) | ||
}, | ||
any: false, | ||
phone: false, | ||
tablet: false, | ||
tablet: false | ||
}; | ||
@@ -109,3 +142,3 @@ result.any = | ||
var isMobile$1 = isMobile(); | ||
var isMobile$1 = isMobile(window.navigator); | ||
@@ -112,0 +145,0 @@ /** |
/*! | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* @pixi/settings - v5.2.2 | ||
* Compiled Tue, 21 Apr 2020 03:53:51 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/settings is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_settings=function(e){"use strict";var i=/iPhone/i,t=/iPod/i,n=/iPad/i,a=/\bAndroid(?:.+)Mobile\b/i,r=/Android/i,o=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,d=/Silk/i,p=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,s=/BlackBerry/i,b=/BB10/i,E=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,c=/Mobile(?:.+)Firefox\b/i;function h(e,i){return e.test(i)}var _=function(e){var _=(e=e||("undefined"!=typeof navigator?navigator.userAgent:"")).split("[FBAN");void 0!==_[1]&&(e=_[0]),void 0!==(_=e.split("Twitter"))[1]&&(e=_[0]);var I={apple:{phone:h(i,e)&&!h(p,e),ipod:h(t,e),tablet:!h(i,e)&&h(n,e)&&!h(p,e),device:(h(i,e)||h(t,e)||h(n,e))&&!h(p,e)},amazon:{phone:h(o,e),tablet:!h(o,e)&&h(d,e),device:h(o,e)||h(d,e)},android:{phone:!h(p,e)&&h(o,e)||!h(p,e)&&h(a,e),tablet:!h(p,e)&&!h(o,e)&&!h(a,e)&&(h(d,e)||h(r,e)),device:!h(p,e)&&(h(o,e)||h(d,e)||h(a,e)||h(r,e))||h(/\bokhttp\b/i,e)},windows:{phone:h(p,e),tablet:h(l,e),device:h(p,e)||h(l,e)},other:{blackberry:h(s,e),blackberry10:h(b,e),opera:h(E,e),firefox:h(c,e),chrome:h(v,e),device:h(s,e)||h(b,e)||h(E,e)||h(c,e)||h(v,e)},any:!1,phone:!1,tablet:!1};return I.any=I.apple.device||I.android.device||I.windows.device||I.other.device,I.phone=I.apple.phone||I.android.phone||I.windows.phone,I.tablet=I.apple.tablet||I.android.tablet||I.windows.tablet,I}();var I={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(e){var i=!0;if(_.tablet||_.phone){if(i=!1,_.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);t&&parseInt(t[1],10)>=11&&(i=!0)}if(_.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)>=7&&(i=!0)}}return i?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:_.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!_.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};return e.isMobile=_,e.settings=I,e}({});Object.assign(this.PIXI,_pixi_settings); | ||
this.PIXI=this.PIXI||{};var _pixi_settings=function(e){"use strict";var i=/iPhone/i,t=/iPod/i,n=/iPad/i,a=/\biOS-universal(?:.+)Mac\b/i,o=/\bAndroid(?:.+)Mobile\b/i,r=/Android/i,d=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,s=/Silk/i,p=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,u=/BB10/i,v=/Opera Mini/i,h=/\b(CriOS|Chrome)(?:.+)Mobile/i,b=/Mobile(?:.+)Firefox\b/i,A=function(e){return void 0!==e&&"MacIntel"===e.platform&&"number"==typeof e.maxTouchPoints&&e.maxTouchPoints>1&&"undefined"==typeof MSStream};var E=function(e){var E={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?E.userAgent=e:e&&e.userAgent&&(E={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):E={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var _=E.userAgent,f=_.split("[FBAN");void 0!==f[1]&&(_=f[0]),void 0!==(f=_.split("Twitter"))[1]&&(_=f[0]);var g=function(e){return function(i){return i.test(e)}}(_),I={apple:{phone:g(i)&&!g(p),ipod:g(t),tablet:!g(i)&&(g(n)||A(E))&&!g(p),universal:g(a),device:(g(i)||g(t)||g(n)||g(a)||A(E))&&!g(p)},amazon:{phone:g(d),tablet:!g(d)&&g(s),device:g(d)||g(s)},android:{phone:!g(p)&&g(d)||!g(p)&&g(o),tablet:!g(p)&&!g(d)&&!g(o)&&(g(s)||g(r)),device:!g(p)&&(g(d)||g(s)||g(o)||g(r))||g(/\bokhttp\b/i)},windows:{phone:g(p),tablet:g(l),device:g(p)||g(l)},other:{blackberry:g(c),blackberry10:g(u),opera:g(v),firefox:g(b),chrome:g(h),device:g(c)||g(u)||g(v)||g(b)||g(h)},any:!1,phone:!1,tablet:!1};return I.any=I.apple.device||I.android.device||I.windows.device||I.other.device,I.phone=I.apple.phone||I.android.phone||I.windows.phone,I.tablet=I.apple.tablet||I.android.tablet||I.windows.tablet,I}(window.navigator);var _={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(e){var i=!0;if(E.tablet||E.phone){if(i=!1,E.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);t&&parseInt(t[1],10)>=11&&(i=!0)}if(E.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)>=7&&(i=!0)}}return i?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:E.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!E.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};return e.isMobile=E,e.settings=_,e}({});Object.assign(this.PIXI,_pixi_settings); | ||
//# sourceMappingURL=settings.min.js.map |
/*! | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* @pixi/settings - v5.2.2 | ||
* Compiled Tue, 21 Apr 2020 03:53:51 UTC | ||
* | ||
@@ -12,3 +12,3 @@ * @pixi/settings is licensed under the MIT License. | ||
var isMobile = isMobileCall(); | ||
var isMobile = isMobileCall(window.navigator); | ||
@@ -15,0 +15,0 @@ /** |
/*! | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* @pixi/settings - v5.2.2 | ||
* Compiled Tue, 21 Apr 2020 03:53:51 UTC | ||
* | ||
@@ -18,3 +18,3 @@ * @pixi/settings is licensed under the MIT License. | ||
var isMobile = isMobileCall(); | ||
var isMobile = isMobileCall(window.navigator); | ||
@@ -21,0 +21,0 @@ /** |
{ | ||
"name": "@pixi/settings", | ||
"version": "5.2.1", | ||
"version": "5.2.2", | ||
"main": "lib/settings.js", | ||
@@ -27,5 +27,5 @@ "module": "lib/settings.es.js", | ||
"dependencies": { | ||
"ismobilejs": "^1.0.3" | ||
"ismobilejs": "^1.1.0" | ||
}, | ||
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3" | ||
"gitHead": "c163c466c20f2286b6e41ab90d68a03aad2051d4" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96941
1017
Updatedismobilejs@^1.1.0