apex4x
Version:
The Comprehensive ARIA Development Suite
5 lines • 5.6 kB
JavaScript
/*@license
* current-device v0.10.1 - https://github.com/matthewhudson/current-device
* MIT Licensed
*/
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.device=e():n.device=e()}(window,function(){return o=[function(n,e,o){n.exports=o(1)},function(n,e,o){o.r(e);var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i=window.device,r={},a=[],c=(window.device=r,window.document.documentElement),d=window.navigator.userAgent.toLowerCase(),l=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","pov_tv","hbbtv","ce-html"];function u(n,e){return-1!==n.indexOf(e)}function s(n){return u(d,n)}function f(n){return c.className.match(new RegExp(n,"i"))}function b(n){var e;f(n)||(e=c.className.replace(/^\s+|\s+$/g,""),c.className=e+" "+n)}function p(n){f(n)&&(c.className=c.className.replace(" "+n,""))}function w(){r.landscape()?(p("portrait"),b("landscape"),y("landscape")):(p("landscape"),b("portrait"),y("portrait")),h()}function y(n){for(var e=0;e<a.length;e++)a[e](n)}r.macos=function(){return s("mac")},r.ios=function(){return r.iphone()||r.ipod()||r.ipad()},r.iphone=function(){return!r.windows()&&s("iphone")},r.ipod=function(){return s("ipod")},r.ipad=function(){var n="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return s("ipad")||n},r.android=function(){return!r.windows()&&s("android")},r.androidPhone=function(){return r.android()&&s("mobile")},r.androidTablet=function(){return r.android()&&!s("mobile")},r.blackberry=function(){return s("blackberry")||s("bb10")},r.blackberryPhone=function(){return r.blackberry()&&!s("tablet")},r.blackberryTablet=function(){return r.blackberry()&&s("tablet")},r.windows=function(){return s("windows")},r.windowsPhone=function(){return r.windows()&&s("phone")},r.windowsTablet=function(){return r.windows()&&s("touch")&&!r.windowsPhone()},r.fxos=function(){return(s("(mobile")||s("(tablet"))&&s(" rv:")},r.fxosPhone=function(){return r.fxos()&&s("mobile")},r.fxosTablet=function(){return r.fxos()&&s("tablet")},r.meego=function(){return s("meego")},r.cordova=function(){return window.cordova&&"file:"===location.protocol},r.nodeWebkit=function(){return"object"===t(window.process)},r.mobile=function(){return r.androidPhone()||r.iphone()||r.ipod()||r.windowsPhone()||r.blackberryPhone()||r.fxosPhone()||r.meego()},r.tablet=function(){return r.ipad()||r.androidTablet()||r.blackberryTablet()||r.windowsTablet()||r.fxosTablet()},r.desktop=function(){return!r.tablet()&&!r.mobile()},r.television=function(){for(var n=0;n<l.length;){if(s(l[n]))return!0;n++}return!1},r.portrait=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?u(screen.orientation.type,"portrait"):r.ios()&&Object.prototype.hasOwnProperty.call(window,"orientation")?90!==Math.abs(window.orientation):1<window.innerHeight/window.innerWidth},r.landscape=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?u(screen.orientation.type,"landscape"):r.ios()&&Object.prototype.hasOwnProperty.call(window,"orientation")?90===Math.abs(window.orientation):window.innerHeight/window.innerWidth<1},r.noConflict=function(){return window.device=i,this},r.ios()?r.ipad()?b("ios ipad tablet"):r.iphone()?b("ios iphone mobile"):r.ipod()&&b("ios ipod mobile"):r.macos()?b("macos desktop"):r.android()?r.androidTablet()?b("android tablet"):b("android mobile"):r.blackberry()?r.blackberryTablet()?b("blackberry tablet"):b("blackberry mobile"):r.windows()?r.windowsTablet()?b("windows tablet"):r.windowsPhone()?b("windows mobile"):b("windows desktop"):r.fxos()?r.fxosTablet()?b("fxos tablet"):b("fxos mobile"):r.meego()?b("meego mobile"):r.nodeWebkit()?b("node-webkit"):r.television()?b("television"):r.desktop()&&b("desktop"),r.cordova()&&b("cordova"),r.onChangeOrientation=function(n){"function"==typeof n&&a.push(n)};o="resize";function m(n){for(var e=0;e<n.length;e++)if(r[n[e]]())return n[e];return"unknown"}function h(){r.orientation=m(["portrait","landscape"])}Object.prototype.hasOwnProperty.call(window,"onorientationchange")&&(o="orientationchange"),window.addEventListener?window.addEventListener(o,w,!1):window.attachEvent?window.attachEvent(o,w):window[o]=w,w(),r.type=m(["mobile","tablet","desktop"]),r.os=m(["ios","iphone","ipad","ipod","android","blackberry","macos","windows","fxos","meego","television"]),h(),e.default=r}],t={},i.m=o,i.c=t,i.d=function(n,e,o){i.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:o})},i.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(e,n){if(1&n&&(e=i(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)i.d(o,t,function(n){return e[n]}.bind(null,t));return o},i.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(e,"a",e),e},i.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},i.p="",i(i.s=0).default;function i(n){var e;return(t[n]||(e=t[n]={i:n,l:!1,exports:{}},o[n].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var o,t}),$A.extend({device:window.device});