current-device-v2
Advanced tools
Comparing version 0.10.7 to 0.10.8
@@ -47,3 +47,3 @@ // Save the previous value of the device variable. | ||
var hash = 0; | ||
for (i = 0; i < src.length; i++) { | ||
for (var i = 0; i < src.length; i++) { | ||
var _char = src.charCodeAt(i); | ||
@@ -50,0 +50,0 @@ hash = (hash << 5) - hash + _char; |
@@ -51,3 +51,3 @@ "use strict"; | ||
var hash = 0; | ||
for (i = 0; i < src.length; i++) { | ||
for (var i = 0; i < src.length; i++) { | ||
var _char = src.charCodeAt(i); | ||
@@ -54,0 +54,0 @@ hash = (hash << 5) - hash + _char; |
{ | ||
"name": "current-device-v2", | ||
"version": "0.10.7", | ||
"version": "0.10.8", | ||
"homepage": "https://github.com/matvejs16/current-device-v2", | ||
@@ -5,0 +5,0 @@ "description": "The easiest way to write conditional CSS and/or JavaScript based on device operating system (iOS, Android, Blackberry, Windows, Firefox OS, MeeGo, AppleTV, etc), orientation (Portrait vs. Landscape), and type (Tablet vs. Mobile).", |
/*! | ||
* current-device-v2 v0.10.6 - https://github.com/matvejs16/current-device-v2 | ||
* current-device-v2 v0.10.7 - https://github.com/matvejs16/current-device-v2 | ||
* MIT Licensed | ||
@@ -160,3 +160,3 @@ */ | ||
var hash = 0; | ||
for (i = 0; i < src.length; i++) { | ||
for (var i = 0; i < src.length; i++) { | ||
var _char = src.charCodeAt(i); | ||
@@ -163,0 +163,0 @@ hash = (hash << 5) - hash + _char; |
/*! | ||
* current-device-v2 v0.10.6 - https://github.com/matvejs16/current-device-v2 | ||
* current-device-v2 v0.10.7 - https://github.com/matvejs16/current-device-v2 | ||
* MIT Licensed | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.device=n():e.device=n()}(window,(function(){return function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){"use strict";t.r(n);var o=window.device,r={},a=[];window.device=r;var c=window.document.documentElement,l=window.navigator.userAgent.toLowerCase(),d=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","pov_tv","hbbtv","ce-html"],u=document.createElement("canvas"),s=u.getContext("2d");s.fillStyle="rgb(255,0,255)",s.beginPath(),s.rect(20,20,150,100),s.fill(),s.stroke(),s.closePath(),s.beginPath(),s.fillStyle="rgb(0,255,255)",s.arc(50,50,50,0,2*Math.PI,!0),s.fill(),s.stroke(),s.closePath();s.textBaseline="top",s.font='17px "Arial 17"',s.textBaseline="alphabetic",s.fillStyle="rgb(255,5,5)",s.rotate(.03),s.fillText("abz190#$%^@£éú",4,17),s.fillStyle="rgb(155,255,5)",s.shadowBlur=8,s.shadowColor="red",s.fillRect(20,12,100,5);var f=u.toDataURL(),p=0;for(i=0;i<f.length;i++){p=(p<<5)-p+f.charCodeAt(i),p&=p}function b(e,n){return-1!==e.indexOf(n)}function w(e){return b(l,e)}function h(e){return c.className.match(new RegExp(e,"i"))}function m(e){var n=null;h(e)||(n=c.className.replace(/^\s+|\s+$/g,""),c.className=n+" "+e)}function y(e){h(e)&&(c.className=c.className.replace(" "+e,""))}function v(){r.landscape()?(y("portrait"),m("landscape"),g("landscape")):(y("landscape"),m("portrait"),g("portrait")),P()}function g(e){for(var n=0;n<a.length;n++)a[n](e)}r.fingerprint={hash:p,pxDepth:window.screen.pixelDepth,colorDepth:window.screen.colorDepth},r.macos=function(){return w("mac")},r.ios=function(){return r.iphone()||r.ipod()||r.ipad()},r.iphone=function(){return!r.windows()&&w("iphone")},r.ipod=function(){return w("ipod")},r.ipad=function(){var e="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;return w("ipad")||e},r.android=function(){return!r.windows()&&w("android")},r.androidPhone=function(){return r.android()&&w("mobile")},r.androidTablet=function(){return r.android()&&!w("mobile")},r.blackberry=function(){return w("blackberry")||w("bb10")},r.blackberryPhone=function(){return r.blackberry()&&!w("tablet")},r.blackberryTablet=function(){return r.blackberry()&&w("tablet")},r.windows=function(){return w("windows")},r.windowsPhone=function(){return r.windows()&&w("phone")},r.windowsTablet=function(){return r.windows()&&w("touch")&&!r.windowsPhone()},r.fxos=function(){return(w("(mobile")||w("(tablet"))&&w(" rv:")},r.fxosPhone=function(){return r.fxos()&&w("mobile")},r.fxosTablet=function(){return r.fxos()&&w("tablet")},r.meego=function(){return w("meego")},r.cordova=function(){return window.cordova&&"file:"===location.protocol},r.nodeWebkit=function(){return"object"==typeof 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 e=0;e<d.length;){if(w(d[e]))return!0;e++}return!1},r.portrait=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?b(screen.orientation.type,"portrait"):r.ios()&&Object.prototype.hasOwnProperty.call(window,"orientation")?90!==Math.abs(window.orientation):window.innerHeight/window.innerWidth>1},r.landscape=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?b(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=o,this},r.ios()?r.ipad()?m("ios ipad tablet"):r.iphone()?m("ios iphone mobile"):r.ipod()&&m("ios ipod mobile"):r.macos()?m("macos desktop"):r.android()?r.androidTablet()?m("android tablet"):m("android mobile"):r.blackberry()?r.blackberryTablet()?m("blackberry tablet"):m("blackberry mobile"):r.windows()?r.windowsTablet()?m("windows tablet"):r.windowsPhone()?m("windows mobile"):m("windows desktop"):r.fxos()?r.fxosTablet()?m("fxos tablet"):m("fxos mobile"):r.meego()?m("meego mobile"):r.nodeWebkit()?m("node-webkit"):r.television()?m("television"):r.desktop()&&m("desktop"),r.cordova()&&m("cordova"),r.onChangeOrientation=function(e){"function"==typeof e&&a.push(e)};var x="resize";function k(e){for(var n=0;n<e.length;n++)if(r[e[n]]())return e[n];return"unknown"}function P(){r.orientation=k(["portrait","landscape"])}Object.prototype.hasOwnProperty.call(window,"onorientationchange")&&(x="orientationchange"),window.addEventListener?window.addEventListener(x,v,!1):window.attachEvent?window.attachEvent(x,v):window[x]=v,v(),r.type=k(["mobile","tablet","desktop"]),r.os=k(["ios","iphone","ipad","ipod","android","blackberry","macos","windows","fxos","meego","television"]),P(),n.default=r}]).default})); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.device=n():e.device=n()}(window,(function(){return function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){"use strict";t.r(n);var o=window.device,r={},i=[];window.device=r;var a=window.document.documentElement,c=window.navigator.userAgent.toLowerCase(),l=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","pov_tv","hbbtv","ce-html"],d=document.createElement("canvas"),u=d.getContext("2d");u.fillStyle="rgb(255,0,255)",u.beginPath(),u.rect(20,20,150,100),u.fill(),u.stroke(),u.closePath(),u.beginPath(),u.fillStyle="rgb(0,255,255)",u.arc(50,50,50,0,2*Math.PI,!0),u.fill(),u.stroke(),u.closePath();u.textBaseline="top",u.font='17px "Arial 17"',u.textBaseline="alphabetic",u.fillStyle="rgb(255,5,5)",u.rotate(.03),u.fillText("abz190#$%^@£éú",4,17),u.fillStyle="rgb(155,255,5)",u.shadowBlur=8,u.shadowColor="red",u.fillRect(20,12,100,5);for(var s=d.toDataURL(),f=0,p=0;p<s.length;p++){f=(f<<5)-f+s.charCodeAt(p),f&=f}function b(e,n){return-1!==e.indexOf(n)}function w(e){return b(c,e)}function h(e){return a.className.match(new RegExp(e,"i"))}function m(e){var n=null;h(e)||(n=a.className.replace(/^\s+|\s+$/g,""),a.className=n+" "+e)}function y(e){h(e)&&(a.className=a.className.replace(" "+e,""))}function v(){r.landscape()?(y("portrait"),m("landscape"),g("landscape")):(y("landscape"),m("portrait"),g("portrait")),P()}function g(e){for(var n=0;n<i.length;n++)i[n](e)}r.fingerprint={hash:f,pxDepth:window.screen.pixelDepth,colorDepth:window.screen.colorDepth},r.macos=function(){return w("mac")},r.ios=function(){return r.iphone()||r.ipod()||r.ipad()},r.iphone=function(){return!r.windows()&&w("iphone")},r.ipod=function(){return w("ipod")},r.ipad=function(){var e="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;return w("ipad")||e},r.android=function(){return!r.windows()&&w("android")},r.androidPhone=function(){return r.android()&&w("mobile")},r.androidTablet=function(){return r.android()&&!w("mobile")},r.blackberry=function(){return w("blackberry")||w("bb10")},r.blackberryPhone=function(){return r.blackberry()&&!w("tablet")},r.blackberryTablet=function(){return r.blackberry()&&w("tablet")},r.windows=function(){return w("windows")},r.windowsPhone=function(){return r.windows()&&w("phone")},r.windowsTablet=function(){return r.windows()&&w("touch")&&!r.windowsPhone()},r.fxos=function(){return(w("(mobile")||w("(tablet"))&&w(" rv:")},r.fxosPhone=function(){return r.fxos()&&w("mobile")},r.fxosTablet=function(){return r.fxos()&&w("tablet")},r.meego=function(){return w("meego")},r.cordova=function(){return window.cordova&&"file:"===location.protocol},r.nodeWebkit=function(){return"object"==typeof 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 e=0;e<l.length;){if(w(l[e]))return!0;e++}return!1},r.portrait=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?b(screen.orientation.type,"portrait"):r.ios()&&Object.prototype.hasOwnProperty.call(window,"orientation")?90!==Math.abs(window.orientation):window.innerHeight/window.innerWidth>1},r.landscape=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?b(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=o,this},r.ios()?r.ipad()?m("ios ipad tablet"):r.iphone()?m("ios iphone mobile"):r.ipod()&&m("ios ipod mobile"):r.macos()?m("macos desktop"):r.android()?r.androidTablet()?m("android tablet"):m("android mobile"):r.blackberry()?r.blackberryTablet()?m("blackberry tablet"):m("blackberry mobile"):r.windows()?r.windowsTablet()?m("windows tablet"):r.windowsPhone()?m("windows mobile"):m("windows desktop"):r.fxos()?r.fxosTablet()?m("fxos tablet"):m("fxos mobile"):r.meego()?m("meego mobile"):r.nodeWebkit()?m("node-webkit"):r.television()?m("television"):r.desktop()&&m("desktop"),r.cordova()&&m("cordova"),r.onChangeOrientation=function(e){"function"==typeof e&&i.push(e)};var x="resize";function k(e){for(var n=0;n<e.length;n++)if(r[e[n]]())return e[n];return"unknown"}function P(){r.orientation=k(["portrait","landscape"])}Object.prototype.hasOwnProperty.call(window,"onorientationchange")&&(x="orientationchange"),window.addEventListener?window.addEventListener(x,v,!1):window.attachEvent?window.attachEvent(x,v):window[x]=v,v(),r.type=k(["mobile","tablet","desktop"]),r.os=k(["ios","iphone","ipad","ipod","android","blackberry","macos","windows","fxos","meego","television"]),P(),n.default=r}]).default})); | ||
//# sourceMappingURL=current-device-v2.min.js.map |
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
71348