From f02bf85687c9cbc44f4e31df4f383d7fe96f09c8 Mon Sep 17 00:00:00 2001 From: Baris Aydinoglu Date: Sat, 3 Jan 2015 16:41:12 +0200 Subject: [PATCH] Detect screen fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “screen” object added to Detectizr.device. Detectizr.device.screen.resolution=hight defines high resolution displays (like Retina, HiDPI, etc...) --- dist/detectizr.js | 125 +++++++++++++++++++++++------------------ dist/detectizr.min.js | 2 +- dist/detectizr.min.map | 2 +- src/detectizr.js | 125 +++++++++++++++++++++++------------------ 4 files changed, 144 insertions(+), 110 deletions(-) diff --git a/dist/detectizr.js b/dist/detectizr.js index e6b67a8..9da7feb 100644 --- a/dist/detectizr.js +++ b/dist/detectizr.js @@ -55,6 +55,7 @@ window.Detectizr = (function(window, navigator, document, undefined) { resizeTimeoutId, oldOrientation; + // Create Global "extend" method, so Detectizr does not need jQuery.extend function extend(obj, extObj) { var a, b, i; if (arguments.length > 2) { @@ -127,24 +128,6 @@ window.Detectizr = (function(window, navigator, document, undefined) { } } - function checkOrientation() { - //timeout wrapper points with doResizeCode as callback - window.clearTimeout(resizeTimeoutId); - resizeTimeoutId = window.setTimeout(function() { - oldOrientation = Detectizr.device.orientation; - //wrapper for height/width check - if (window.innerHeight > window.innerWidth) { - Detectizr.device.orientation = "portrait"; - } else { - Detectizr.device.orientation = "landscape"; - } - addConditionalTest(Detectizr.device.orientation, true); - if (oldOrientation !== Detectizr.device.orientation) { - addConditionalTest(oldOrientation, false); - } - }, 10); - } - // add test to Modernizr based on a condition function addConditionalTest(feature, test) { if (!!feature && !!Modernizr) { @@ -185,10 +168,58 @@ window.Detectizr = (function(window, navigator, document, undefined) { } } + function checkOrientation() { + //timeout wrapper points with doResizeCode as callback + window.clearTimeout(resizeTimeoutId); + resizeTimeoutId = window.setTimeout(function() { + oldOrientation = Detectizr.device.orientation; + //wrapper for height/width check + if (window.innerHeight > window.innerWidth) { + Detectizr.device.orientation = "portrait"; + } else { + Detectizr.device.orientation = "landscape"; + } + addConditionalTest(Detectizr.device.orientation, true); + if (oldOrientation !== Detectizr.device.orientation) { + addConditionalTest(oldOrientation, false); + } + }, 10); + } + + function detectPlugin(substrs) { + var plugins = navigator.plugins, + plugin, haystack, pluginFoundText, j, k; + for (j = plugins.length - 1; j >= 0; j--) { + plugin = plugins[j]; + haystack = plugin.name + plugin.description; + pluginFoundText = 0; + for (k = substrs.length; k >= 0; k--) { + if (haystack.indexOf(substrs[k]) !== -1) { + pluginFoundText += 1; + } + } + if (pluginFoundText === substrs.length) { + return true; + } + } + return false; + } + + function detectObject(progIds) { + var j; + for (j = progIds.length - 1; j >= 0; j--) { + try { + new ActiveXObject(progIds[j]); + } catch (e) { + // Ignore + } + } + return false; + } + function detect(opt) { - // Create Global "extend" method, so Detectizr does not need jQuery.extend - var that = this, - i, j, k, device, os, browser, plugin2detect, pluginFound; + var i, j, device, os, browser, plugin2detect, pluginFound; + options = extend({}, options, opt || {}); /** Device detection **/ @@ -281,10 +312,24 @@ window.Detectizr = (function(window, navigator, document, undefined) { /** Screen detection **/ if (options.detectScreen) { + device.screen = {}; if (!!Modernizr && !!Modernizr.mq) { - addConditionalTest("smallScreen", Modernizr.mq("only screen and (max-width: 480px)")); - addConditionalTest("verySmallScreen", Modernizr.mq("only screen and (max-width: 320px)")); - addConditionalTest("veryVerySmallScreen", Modernizr.mq("only screen and (max-width: 240px)")); + if (Modernizr.mq("only screen and (max-width: 240px)")) { + device.screen.size = "veryVerySmall"; + addConditionalTest("veryVerySmallScreen", true); + } else if (Modernizr.mq("only screen and (max-width: 320px)")) { + device.screen.size = "verySmall"; + addConditionalTest("verySmallScreen", true); + } else if (Modernizr.mq("only screen and (max-width: 480px)")) { + device.screen.size = "small"; + addConditionalTest("smallScreen", true); + } + if (device.type === deviceTypes[1] || device.type === deviceTypes[2]) { + if (Modernizr.mq("only screen and (-moz-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)")) { + device.screen.resolution = "high"; + addConditionalTest("highresolution", true); + } + } } if (device.type === deviceTypes[1] || device.type === deviceTypes[2]) { window.onresize = function(event) { @@ -440,41 +485,13 @@ window.Detectizr = (function(window, navigator, document, undefined) { /** Plugin detection **/ if (options.detectPlugins) { browser.plugins = []; - that.detectPlugin = function(substrs) { - var plugins = navigator.plugins, - plugin, haystack, pluginFoundText; - for (j = plugins.length - 1; j >= 0; j--) { - plugin = plugins[j]; - haystack = plugin.name + plugin.description; - pluginFoundText = 0; - for (k = substrs.length; k >= 0; k--) { - if (haystack.indexOf(substrs[k]) !== -1) { - pluginFoundText += 1; - } - } - if (pluginFoundText === substrs.length) { - return true; - } - } - return false; - }; - that.detectObject = function(progIds) { - for (j = progIds.length - 1; j >= 0; j--) { - try { - new ActiveXObject(progIds[j]); - } catch (e) { - // Ignore - } - } - return false; - }; for (i = plugins2detect.length - 1; i >= 0; i--) { plugin2detect = plugins2detect[i]; pluginFound = false; if (window.ActiveXObject) { - pluginFound = that.detectObject(plugin2detect.progIds); + pluginFound = detectObject(plugin2detect.progIds); } else if (navigator.plugins) { - pluginFound = that.detectPlugin(plugin2detect.substrs); + pluginFound = detectPlugin(plugin2detect.substrs); } if (pluginFound) { browser.plugins.push(plugin2detect.name); diff --git a/dist/detectizr.min.js b/dist/detectizr.min.js index 815e27c..af255b7 100644 --- a/dist/detectizr.min.js +++ b/dist/detectizr.min.js @@ -1,4 +1,4 @@ /*! Detectizr v2.1.0 | (c) 2012 Baris Aydinoglu | Licensed MIT //# sourceMappingURL=detectizr.min.map */ -window.Detectizr=function(a,b,c,d){var e,f,g={},h=a.Modernizr,i=["tv","tablet","mobile","desktop"],j={addAllFeaturesAsClass:!1,detectDevice:!0,detectDeviceModel:!0,detectScreen:!0,detectOS:!0,detectBrowser:!0,detectPlugins:!0},k=[{name:"adobereader",substrs:["Adobe","Acrobat"],progIds:["AcroPDF.PDF","PDF.PDFCtrl.5"]},{name:"flash",substrs:["Shockwave Flash"],progIds:["ShockwaveFlash.ShockwaveFlash.1"]},{name:"wmplayer",substrs:["Windows Media"],progIds:["wmplayer.ocx"]},{name:"silverlight",substrs:["Silverlight"],progIds:["AgControl.AgControl"]},{name:"quicktime",substrs:["QuickTime"],progIds:["QuickTime.QuickTime"]}],l=/[\t\r\n]/g,m=c.documentElement;function n(a,b){var c,d,e;if(arguments.length>2)for(c=1,d=arguments.length;d>c;c+=1)n(a,arguments[c]);else for(e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);return a}function o(a){return g.browser.userAgent.indexOf(a)>-1}function p(a){return a.test(g.browser.userAgent)}function q(a){return a.exec(g.browser.userAgent)}function r(a){return a.replace(/^\s+|\s+$/g,"")}function s(a){return null===a||a===d?"":String(a).replace(/((\s|\-|\.)+[a-z0-9])/g,function(a){return a.toUpperCase().replace(/(\s|\-|\.)/g,"")})}function t(a,b){var c=b||"",d=1===a.nodeType&&(a.className?(" "+a.className+" ").replace(l," "):"");if(d){while(d.indexOf(" "+c+" ")>=0)d=d.replace(" "+c+" "," ");a.className=b?r(d):""}}function u(a,b,c){a&&(a=s(a),b&&(b=s(b),w(a+b,!0),c&&w(a+b+"_"+c,!0)))}function v(){a.clearTimeout(e),e=a.setTimeout(function(){f=g.device.orientation,g.device.orientation=a.innerHeight>a.innerWidth?"portrait":"landscape",w(g.device.orientation,!0),f!==g.device.orientation&&w(f,!1)},10)}function w(a,b){a&&h&&(j.addAllFeaturesAsClass?h.addTest(a,b):(b="function"==typeof b?b():b,b?h.addTest(a,!0):(delete h[a],t(m,a))))}function x(a,b){a.version=b;var c=b.split(".");c.length>0?(c=c.reverse(),a.major=c.pop(),c.length>0?(a.minor=c.pop(),c.length>0?(c=c.reverse(),a.patch=c.join(".")):a.patch="0"):a.minor="0"):a.major="0"}function y(d){var e,f,l,m,r,t,y,z,A=this;if(j=n({},j,d||{}),j.detectDevice){for(g.device={type:"",model:"",orientation:""},m=g.device,p(/googletv|smarttv|smart-tv|internet.tv|netcast|nettv|appletv|boxee|kylo|roku|dlnadoc|roku|pov_tv|hbbtv|ce\-html/)?(m.type=i[0],m.model="smartTv"):p(/xbox|playstation.3|wii/)?(m.type=i[0],m.model="gameConsole"):p(/ip(a|ro)d/)?(m.type=i[1],m.model="ipad"):p(/tablet/)&&!p(/rx-34/)||p(/folio/)?(m.type=i[1],m.model=String(q(/playbook/)||"")):p(/linux/)&&p(/android/)&&!p(/fennec|mobi|htc.magic|htcX06ht|nexus.one|sc-02b|fone.945/)?(m.type=i[1],m.model="android"):p(/kindle/)||p(/mac.os/)&&p(/silk/)?(m.type=i[1],m.model="kindle"):p(/gt-p10|sc-01c|shw-m180s|sgh-t849|sch-i800|shw-m180l|sph-p100|sgh-i987|zt180|htc(.flyer|\_flyer)|sprint.atp51|viewpad7|pandigital(sprnova|nova)|ideos.s7|dell.streak.7|advent.vega|a101it|a70bht|mid7015|next2|nook/)||p(/mb511/)&&p(/rutem/)?(m.type=i[1],m.model="android"):p(/bb10/)?(m.type=i[1],m.model="blackberry"):(m.model=q(/iphone|ipod|android|blackberry|opera mini|opera mobi|skyfire|maemo|windows phone|palm|iemobile|symbian|symbianos|fennec|j2me/),null!==m.model?(m.type=i[2],m.model=String(m.model)):(m.model="",p(/bolt|fennec|iris|maemo|minimo|mobi|mowser|netfront|novarra|prism|rx-34|skyfire|tear|xv6875|xv6975|google.wireless.transcoder/)?m.type=i[2]:p(/opera/)&&p(/windows.nt.5/)&&p(/htc|xda|mini|vario|samsung\-gt\-i8000|samsung\-sgh\-i9/)?m.type=i[2]:p(/windows.(nt|xp|me|9)/)&&!p(/phone/)||p(/win(9|.9|nt)/)||p(/\(windows 8\)/)?m.type=i[3]:p(/macintosh|powerpc/)&&!p(/silk/)?(m.type=i[3],m.model="mac"):p(/linux/)&&p(/x11/)?m.type=i[3]:p(/solaris|sunos|bsd/)?m.type=i[3]:p(/cros/)?m.type=i[3]:p(/bot|crawler|spider|yahoo|ia_archiver|covario-ids|findlinks|dataparksearch|larbin|mediapartners-google|ng-search|snappy|teoma|jeeves|tineye/)&&!p(/mobile/)?(m.type=i[3],m.model="crawler"):m.type=i[2])),e=0,f=i.length;f>e;e+=1)w(i[e],m.type===i[e]);j.detectDeviceModel&&w(s(m.model),!0)}if(j.detectScreen&&(h&&h.mq&&(w("smallScreen",h.mq("only screen and (max-width: 480px)")),w("verySmallScreen",h.mq("only screen and (max-width: 320px)")),w("veryVerySmallScreen",h.mq("only screen and (max-width: 240px)"))),m.type===i[1]||m.type===i[2]?(a.onresize=function(a){v(a)},v()):(m.orientation="landscape",w(m.orientation,!0))),j.detectOS&&(g.os={},r=g.os,""!==m.model&&("ipad"===m.model||"iphone"===m.model||"ipod"===m.model?(r.name="ios",x(r,(p(/os\s([\d_]+)/)?RegExp.$1:"").replace(/_/g,"."))):"android"===m.model?(r.name="android",x(r,p(/android\s([\d\.]+)/)?RegExp.$1:"")):"blackberry"===m.model?(r.name="blackberry",x(r,p(/version\/([^\s]+)/)?RegExp.$1:"")):"playbook"===m.model&&(r.name="blackberry",x(r,p(/os ([^\s]+)/)?RegExp.$1.replace(";",""):""))),r.name||(o("win")||o("16bit")?(r.name="windows",o("windows nt 6.3")?x(r,"8.1"):o("windows nt 6.2")||p(/\(windows 8\)/)?x(r,"8"):o("windows nt 6.1")?x(r,"7"):o("windows nt 6.0")?x(r,"vista"):o("windows nt 5.2")||o("windows nt 5.1")||o("windows xp")?x(r,"xp"):o("windows nt 5.0")||o("windows 2000")?x(r,"2k"):o("winnt")||o("windows nt")?x(r,"nt"):o("win98")||o("windows 98")?x(r,"98"):(o("win95")||o("windows 95"))&&x(r,"95")):o("mac")||o("darwin")?(r.name="mac os",o("68k")||o("68000")?x(r,"68k"):o("ppc")||o("powerpc")?x(r,"ppc"):o("os x")&&x(r,(p(/os\sx\s([\d_]+)/)?RegExp.$1:"os x").replace(/_/g,"."))):o("webtv")?r.name="webtv":o("x11")||o("inux")?r.name="linux":o("sunos")?r.name="sun":o("irix")?r.name="irix":o("freebsd")?r.name="freebsd":o("bsd")&&(r.name="bsd")),r.name&&(w(r.name,!0),r.major&&(u(r.name,r.major),r.minor&&u(r.name,r.major,r.minor))),r.addressRegisterSize=p(/\sx64|\sx86|\swin64|\swow64|\samd64/)?"64bit":"32bit",w(r.addressRegisterSize,!0)),j.detectBrowser&&(t=g.browser,p(/opera|webtv/)||!p(/msie\s([\d\w\.]+)/)&&!o("trident")?o("firefox")?(t.engine="gecko",t.name="firefox",x(t,p(/firefox\/([\d\w\.]+)/)?RegExp.$1:"")):o("gecko/")?t.engine="gecko":o("opera")?(t.name="opera",t.engine="presto",x(t,p(/version\/([\d\.]+)/)?RegExp.$1:p(/opera(\s|\/)([\d\.]+)/)?RegExp.$2:"")):o("konqueror")?t.name="konqueror":o("chrome")?(t.engine="webkit",t.name="chrome",x(t,p(/chrome\/([\d\.]+)/)?RegExp.$1:"")):o("iron")?(t.engine="webkit",t.name="iron"):o("crios")?(t.name="chrome",t.engine="webkit",x(t,p(/crios\/([\d\.]+)/)?RegExp.$1:"")):o("applewebkit/")?(t.name="safari",t.engine="webkit",x(t,p(/version\/([\d\.]+)/)?RegExp.$1:"")):o("mozilla/")&&(t.engine="gecko"):(t.engine="trident",t.name="ie",!a.addEventListener&&c.documentMode&&7===c.documentMode?x(t,"8.compat"):p(/trident.*rv[ :](\d+)\./)?x(t,RegExp.$1):x(t,p(/trident\/4\.0/)?"8":RegExp.$1)),t.name&&(w(t.name,!0),t.major&&(u(t.name,t.major),t.minor&&u(t.name,t.major,t.minor))),w(t.engine,!0),t.language=b.userLanguage||b.language,w(t.language,!0)),j.detectPlugins){for(t.plugins=[],A.detectPlugin=function(a){var c,d,e,g=b.plugins;for(f=g.length-1;f>=0;f--){for(c=g[f],d=c.name+c.description,e=0,l=a.length;l>=0;l--)-1!==d.indexOf(a[l])&&(e+=1);if(e===a.length)return!0}return!1},A.detectObject=function(a){for(f=a.length-1;f>=0;f--)try{new ActiveXObject(a[f])}catch(b){}return!1},e=k.length-1;e>=0;e--)y=k[e],z=!1,a.ActiveXObject?z=A.detectObject(y.progIds):b.plugins&&(z=A.detectPlugin(y.substrs)),z&&(t.plugins.push(y.name),w(y.name,!0));b.javaEnabled()&&(t.plugins.push("java"),w("java",!0))}}return g.detect=function(a){return y(a)},g.init=function(){g!==d&&(g.browser={userAgent:(b.userAgent||b.vendor||a.opera).toLowerCase()},g.detect())},g.init(),g}(this,this.navigator,this.document); \ No newline at end of file +window.Detectizr=function(a,b,c,d){var e,f,g={},h=a.Modernizr,i=["tv","tablet","mobile","desktop"],j={addAllFeaturesAsClass:!1,detectDevice:!0,detectDeviceModel:!0,detectScreen:!0,detectOS:!0,detectBrowser:!0,detectPlugins:!0},k=[{name:"adobereader",substrs:["Adobe","Acrobat"],progIds:["AcroPDF.PDF","PDF.PDFCtrl.5"]},{name:"flash",substrs:["Shockwave Flash"],progIds:["ShockwaveFlash.ShockwaveFlash.1"]},{name:"wmplayer",substrs:["Windows Media"],progIds:["wmplayer.ocx"]},{name:"silverlight",substrs:["Silverlight"],progIds:["AgControl.AgControl"]},{name:"quicktime",substrs:["QuickTime"],progIds:["QuickTime.QuickTime"]}],l=/[\t\r\n]/g,m=c.documentElement;function n(a,b){var c,d,e;if(arguments.length>2)for(c=1,d=arguments.length;d>c;c+=1)n(a,arguments[c]);else for(e in b)b.hasOwnProperty(e)&&(a[e]=b[e]);return a}function o(a){return g.browser.userAgent.indexOf(a)>-1}function p(a){return a.test(g.browser.userAgent)}function q(a){return a.exec(g.browser.userAgent)}function r(a){return a.replace(/^\s+|\s+$/g,"")}function s(a){return null===a||a===d?"":String(a).replace(/((\s|\-|\.)+[a-z0-9])/g,function(a){return a.toUpperCase().replace(/(\s|\-|\.)/g,"")})}function t(a,b){var c=b||"",d=1===a.nodeType&&(a.className?(" "+a.className+" ").replace(l," "):"");if(d){while(d.indexOf(" "+c+" ")>=0)d=d.replace(" "+c+" "," ");a.className=b?r(d):""}}function u(a,b,c){a&&(a=s(a),b&&(b=s(b),v(a+b,!0),c&&v(a+b+"_"+c,!0)))}function v(a,b){a&&h&&(j.addAllFeaturesAsClass?h.addTest(a,b):(b="function"==typeof b?b():b,b?h.addTest(a,!0):(delete h[a],t(m,a))))}function w(a,b){a.version=b;var c=b.split(".");c.length>0?(c=c.reverse(),a.major=c.pop(),c.length>0?(a.minor=c.pop(),c.length>0?(c=c.reverse(),a.patch=c.join(".")):a.patch="0"):a.minor="0"):a.major="0"}function x(){a.clearTimeout(e),e=a.setTimeout(function(){f=g.device.orientation,g.device.orientation=a.innerHeight>a.innerWidth?"portrait":"landscape",v(g.device.orientation,!0),f!==g.device.orientation&&v(f,!1)},10)}function y(a){var c,d,e,f,g,h=b.plugins;for(f=h.length-1;f>=0;f--){for(c=h[f],d=c.name+c.description,e=0,g=a.length;g>=0;g--)-1!==d.indexOf(a[g])&&(e+=1);if(e===a.length)return!0}return!1}function z(a){var b;for(b=a.length-1;b>=0;b--)try{new ActiveXObject(a[b])}catch(c){}return!1}function A(d){var e,f,l,m,r,t,A;if(j=n({},j,d||{}),j.detectDevice){for(g.device={type:"",model:"",orientation:""},l=g.device,p(/googletv|smarttv|smart-tv|internet.tv|netcast|nettv|appletv|boxee|kylo|roku|dlnadoc|roku|pov_tv|hbbtv|ce\-html/)?(l.type=i[0],l.model="smartTv"):p(/xbox|playstation.3|wii/)?(l.type=i[0],l.model="gameConsole"):p(/ip(a|ro)d/)?(l.type=i[1],l.model="ipad"):p(/tablet/)&&!p(/rx-34/)||p(/folio/)?(l.type=i[1],l.model=String(q(/playbook/)||"")):p(/linux/)&&p(/android/)&&!p(/fennec|mobi|htc.magic|htcX06ht|nexus.one|sc-02b|fone.945/)?(l.type=i[1],l.model="android"):p(/kindle/)||p(/mac.os/)&&p(/silk/)?(l.type=i[1],l.model="kindle"):p(/gt-p10|sc-01c|shw-m180s|sgh-t849|sch-i800|shw-m180l|sph-p100|sgh-i987|zt180|htc(.flyer|\_flyer)|sprint.atp51|viewpad7|pandigital(sprnova|nova)|ideos.s7|dell.streak.7|advent.vega|a101it|a70bht|mid7015|next2|nook/)||p(/mb511/)&&p(/rutem/)?(l.type=i[1],l.model="android"):p(/bb10/)?(l.type=i[1],l.model="blackberry"):(l.model=q(/iphone|ipod|android|blackberry|opera mini|opera mobi|skyfire|maemo|windows phone|palm|iemobile|symbian|symbianos|fennec|j2me/),null!==l.model?(l.type=i[2],l.model=String(l.model)):(l.model="",p(/bolt|fennec|iris|maemo|minimo|mobi|mowser|netfront|novarra|prism|rx-34|skyfire|tear|xv6875|xv6975|google.wireless.transcoder/)?l.type=i[2]:p(/opera/)&&p(/windows.nt.5/)&&p(/htc|xda|mini|vario|samsung\-gt\-i8000|samsung\-sgh\-i9/)?l.type=i[2]:p(/windows.(nt|xp|me|9)/)&&!p(/phone/)||p(/win(9|.9|nt)/)||p(/\(windows 8\)/)?l.type=i[3]:p(/macintosh|powerpc/)&&!p(/silk/)?(l.type=i[3],l.model="mac"):p(/linux/)&&p(/x11/)?l.type=i[3]:p(/solaris|sunos|bsd/)?l.type=i[3]:p(/cros/)?l.type=i[3]:p(/bot|crawler|spider|yahoo|ia_archiver|covario-ids|findlinks|dataparksearch|larbin|mediapartners-google|ng-search|snappy|teoma|jeeves|tineye/)&&!p(/mobile/)?(l.type=i[3],l.model="crawler"):l.type=i[2])),e=0,f=i.length;f>e;e+=1)v(i[e],l.type===i[e]);j.detectDeviceModel&&v(s(l.model),!0)}if(j.detectScreen&&(l.screen={},h&&h.mq&&(h.mq("only screen and (max-width: 240px)")?(l.screen.size="veryVerySmall",v("veryVerySmallScreen",!0)):h.mq("only screen and (max-width: 320px)")?(l.screen.size="verySmall",v("verySmallScreen",!0)):h.mq("only screen and (max-width: 480px)")&&(l.screen.size="small",v("smallScreen",!0)),(l.type===i[1]||l.type===i[2])&&h.mq("only screen and (-moz-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)")&&(l.screen.resolution="high",v("highresolution",!0))),l.type===i[1]||l.type===i[2]?(a.onresize=function(a){x(a)},x()):(l.orientation="landscape",v(l.orientation,!0))),j.detectOS&&(g.os={},m=g.os,""!==l.model&&("ipad"===l.model||"iphone"===l.model||"ipod"===l.model?(m.name="ios",w(m,(p(/os\s([\d_]+)/)?RegExp.$1:"").replace(/_/g,"."))):"android"===l.model?(m.name="android",w(m,p(/android\s([\d\.]+)/)?RegExp.$1:"")):"blackberry"===l.model?(m.name="blackberry",w(m,p(/version\/([^\s]+)/)?RegExp.$1:"")):"playbook"===l.model&&(m.name="blackberry",w(m,p(/os ([^\s]+)/)?RegExp.$1.replace(";",""):""))),m.name||(o("win")||o("16bit")?(m.name="windows",o("windows nt 6.3")?w(m,"8.1"):o("windows nt 6.2")||p(/\(windows 8\)/)?w(m,"8"):o("windows nt 6.1")?w(m,"7"):o("windows nt 6.0")?w(m,"vista"):o("windows nt 5.2")||o("windows nt 5.1")||o("windows xp")?w(m,"xp"):o("windows nt 5.0")||o("windows 2000")?w(m,"2k"):o("winnt")||o("windows nt")?w(m,"nt"):o("win98")||o("windows 98")?w(m,"98"):(o("win95")||o("windows 95"))&&w(m,"95")):o("mac")||o("darwin")?(m.name="mac os",o("68k")||o("68000")?w(m,"68k"):o("ppc")||o("powerpc")?w(m,"ppc"):o("os x")&&w(m,(p(/os\sx\s([\d_]+)/)?RegExp.$1:"os x").replace(/_/g,"."))):o("webtv")?m.name="webtv":o("x11")||o("inux")?m.name="linux":o("sunos")?m.name="sun":o("irix")?m.name="irix":o("freebsd")?m.name="freebsd":o("bsd")&&(m.name="bsd")),m.name&&(v(m.name,!0),m.major&&(u(m.name,m.major),m.minor&&u(m.name,m.major,m.minor))),m.addressRegisterSize=p(/\sx64|\sx86|\swin64|\swow64|\samd64/)?"64bit":"32bit",v(m.addressRegisterSize,!0)),j.detectBrowser&&(r=g.browser,p(/opera|webtv/)||!p(/msie\s([\d\w\.]+)/)&&!o("trident")?o("firefox")?(r.engine="gecko",r.name="firefox",w(r,p(/firefox\/([\d\w\.]+)/)?RegExp.$1:"")):o("gecko/")?r.engine="gecko":o("opera")?(r.name="opera",r.engine="presto",w(r,p(/version\/([\d\.]+)/)?RegExp.$1:p(/opera(\s|\/)([\d\.]+)/)?RegExp.$2:"")):o("konqueror")?r.name="konqueror":o("chrome")?(r.engine="webkit",r.name="chrome",w(r,p(/chrome\/([\d\.]+)/)?RegExp.$1:"")):o("iron")?(r.engine="webkit",r.name="iron"):o("crios")?(r.name="chrome",r.engine="webkit",w(r,p(/crios\/([\d\.]+)/)?RegExp.$1:"")):o("applewebkit/")?(r.name="safari",r.engine="webkit",w(r,p(/version\/([\d\.]+)/)?RegExp.$1:"")):o("mozilla/")&&(r.engine="gecko"):(r.engine="trident",r.name="ie",!a.addEventListener&&c.documentMode&&7===c.documentMode?w(r,"8.compat"):p(/trident.*rv[ :](\d+)\./)?w(r,RegExp.$1):w(r,p(/trident\/4\.0/)?"8":RegExp.$1)),r.name&&(v(r.name,!0),r.major&&(u(r.name,r.major),r.minor&&u(r.name,r.major,r.minor))),v(r.engine,!0),r.language=b.userLanguage||b.language,v(r.language,!0)),j.detectPlugins){for(r.plugins=[],e=k.length-1;e>=0;e--)t=k[e],A=!1,a.ActiveXObject?A=z(t.progIds):b.plugins&&(A=y(t.substrs)),A&&(r.plugins.push(t.name),v(t.name,!0));b.javaEnabled()&&(r.plugins.push("java"),v("java",!0))}}return g.detect=function(a){return A(a)},g.init=function(){g!==d&&(g.browser={userAgent:(b.userAgent||b.vendor||a.opera).toLowerCase()},g.detect())},g.init(),g}(this,this.navigator,this.document); \ No newline at end of file diff --git a/dist/detectizr.min.map b/dist/detectizr.min.map index 9977052..64de5a7 100644 --- a/dist/detectizr.min.map +++ b/dist/detectizr.min.map @@ -1 +1 @@ -{"version":3,"file":"detectizr.min.js","sources":["detectizr.js"],"names":["window","Detectizr","navigator","document","undefined","resizeTimeoutId","oldOrientation","Modernizr","deviceTypes","options","addAllFeaturesAsClass","detectDevice","detectDeviceModel","detectScreen","detectOS","detectBrowser","detectPlugins","plugins2detect","name","substrs","progIds","rclass","docElement","documentElement","extend","obj","extObj","a","b","i","arguments","length","hasOwnProperty","is","key","browser","userAgent","indexOf","test","regex","exec","trim","value","replace","toCamel","string","String","$1","toUpperCase","removeClass","element","class2remove","cur","nodeType","className","addVersionTest","version","major","minor","addConditionalTest","checkOrientation","clearTimeout","setTimeout","device","orientation","innerHeight","innerWidth","feature","addTest","setVersion","versionType","versionFull","versionArray","split","reverse","pop","patch","join","detect","opt","j","k","os","plugin2detect","pluginFound","that","this","type","model","mq","onresize","event","RegExp","addressRegisterSize","engine","$2","addEventListener","documentMode","language","userLanguage","plugins","detectPlugin","plugin","haystack","pluginFoundText","description","detectObject","ActiveXObject","e","push","javaEnabled","settings","init","vendor","opera","toLowerCase"],"mappings":";AASAA,OAAOC,UAAa,SAASD,EAAQE,EAAWC,EAAUC,GACzD,GA4CCC,GACAC,EA7CGL,KACHM,EAAYP,EAAOO,UACnBC,GAAe,KAAM,SAAU,SAAU,WACzCC,GAECC,uBAAuB,EAEvBC,cAAc,EAEdC,mBAAmB,EAEnBC,cAAc,EAEdC,UAAU,EAEVC,eAAe,EAEfC,eAAe,GAEhBC,IACCC,KAAM,cACNC,SAAU,QAAS,WAGnBC,SAAU,cAAe,mBAEzBF,KAAM,QACNC,SAAU,mBACVC,SAAU,qCAEVF,KAAM,WACNC,SAAU,iBACVC,SAAU,kBAEVF,KAAM,cACNC,SAAU,eACVC,SAAU,yBAEVF,KAAM,YACNC,SAAU,aACVC,SAAU,yBAEXC,EAAS,YACTC,EAAanB,EAASoB,eAIvB,SAASC,GAAOC,EAAKC,GACpB,GAAIC,GAAGC,EAAGC,CACV,IAAIC,UAAUC,OAAS,EACtB,IAAKJ,EAAI,EAAGC,EAAIE,UAAUC,OAAYH,EAAJD,EAAOA,GA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,IAHAsB,EAASF,EAAQpB,GACjBuB,EAAWD,EAAOpF,KAAOoF,EAAOG,YAChCD,EAAkB,EACbvB,EAAI9D,EAAQY,OAAQkD,GAAK,EAAGA,IACK,KAAjCsB,EAASlE,QAAQlB,EAAQ8D,MAC5BuB,GAAmB,EAGrB,IAAIA,IAAoBrF,EAAQY,OAC/B,OAAO,EAGT,OAAO,GAERsD,EAAKqB,aAAe,SAAStF,GAC5B,IAAK4D,EAAI5D,EAAQW,OAAS,EAAGiD,GAAK,EAAGA,IACpC,IACC,GAAI2B,eAAcvF,EAAQ4D,IACzB,MAAO4B,IAIV,OAAO,GAEH/E,EAAIZ,EAAec,OAAS,EAAGF,GAAK,EAAGA,IAC3CsD,EAAgBlE,EAAeY,GAC/BuD,GAAc,EACVpF,EAAO2G,cACVvB,EAAcC,EAAKqB,aAAavB,EAAc/D,SACpClB,EAAUkG,UACpBhB,EAAcC,EAAKgB,aAAalB,EAAchE,UAE3CiE,IACHjD,EAAQiE,QAAQS,KAAK1B,EAAcjE,MACnCyC,EAAmBwB,EAAcjE,MAAM,GAGrChB,GAAU4G,gBACb3E,EAAQiE,QAAQS,KAAK,QACrBlD,EAAmB,QAAQ,KAiB9B,MAbA1D,GAAU6E,OAAS,SAASiC,GAC3B,MAAOjC,GAAOiC,IAEf9G,EAAU+G,KAAO,WACZ/G,IAAcG,IACjBH,EAAUkC,SACTC,WAAYlC,EAAUkC,WAAalC,EAAU+G,QAAUjH,EAAOkH,OAAOC,eAEtElH,EAAU6E,WAGZ7E,EAAU+G,OAEH/G,GACNqF,KAAMA,KAAKpF,UAAWoF,KAAKnF"} \ No newline at end of file +{"version":3,"file":"detectizr.min.js","sources":["detectizr.js"],"names":["window","Detectizr","navigator","document","undefined","resizeTimeoutId","oldOrientation","Modernizr","deviceTypes","options","addAllFeaturesAsClass","detectDevice","detectDeviceModel","detectScreen","detectOS","detectBrowser","detectPlugins","plugins2detect","name","substrs","progIds","rclass","docElement","documentElement","extend","obj","extObj","a","b","i","arguments","length","hasOwnProperty","is","key","browser","userAgent","indexOf","test","regex","exec","trim","value","replace","toCamel","string","String","$1","toUpperCase","removeClass","element","class2remove","cur","nodeType","className","addVersionTest","version","major","minor","addConditionalTest","feature","addTest","setVersion","versionType","versionFull","versionArray","split","reverse","pop","patch","join","checkOrientation","clearTimeout","setTimeout","device","orientation","innerHeight","innerWidth","detectPlugin","plugin","haystack","pluginFoundText","j","k","plugins","description","detectObject","ActiveXObject","e","detect","opt","os","plugin2detect","pluginFound","type","model","screen","mq","size","resolution","onresize","event","RegExp","addressRegisterSize","engine","$2","addEventListener","documentMode","language","userLanguage","push","javaEnabled","settings","init","vendor","opera","toLowerCase","this"],"mappings":";AASAA,OAAOC,UAAa,SAASD,EAAQE,EAAWC,EAAUC,GACzD,GA4CCC,GACAC,EA7CGL,KACHM,EAAYP,EAAOO,UACnBC,GAAe,KAAM,SAAU,SAAU,WACzCC,GAECC,uBAAuB,EAEvBC,cAAc,EAEdC,mBAAmB,EAEnBC,cAAc,EAEdC,UAAU,EAEVC,eAAe,EAEfC,eAAe,GAEhBC,IACCC,KAAM,cACNC,SAAU,QAAS,WAGnBC,SAAU,cAAe,mBAEzBF,KAAM,QACNC,SAAU,mBACVC,SAAU,qCAEVF,KAAM,WACNC,SAAU,iBACVC,SAAU,kBAEVF,KAAM,cACNC,SAAU,eACVC,SAAU,yBAEVF,KAAM,YACNC,SAAU,aACVC,SAAU,yBAEXC,EAAS,YACTC,EAAanB,EAASoB,eAKvB,SAASC,GAAOC,EAAKC,GACpB,GAAIC,GAAGC,EAAGC,CACV,IAAIC,UAAUC,OAAS,EACtB,IAAKJ,EAAI,EAAGC,EAAIE,UAAUC,OAAYH,EAAJD,EAAOA,GAAK,EAC7CH,EAAOC,EAAKK,UAAUH,QAGvB,KAAKE,IAAKH,GACLA,EAAOM,eAAeH,KACzBJ,EAAII,GAAKH,EAAOG,GAInB,OAAOJ,GAIR,QAASQ,GAAGC,GACX,MAAOjC,GAAUkC,QAAQC,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3B,EAAS,YACVG,EAAK,0BACfwB,EAAW3B,EAASmE,OAAOvD,IAE3Be,EAAW3B,EAAUG,EAAK,iBAAmB,IAAMgE,OAAOvD,KAgCtDZ,EAAQjB,OACbyC,EAAmBxB,EAAQjB,MAAM,GAC3BiB,EAAQsB,QACbF,EAAepB,EAAQjB,KAAMiB,EAAQsB,OAC/BtB,EAAQuB,OACbH,EAAepB,EAAQjB,KAAMiB,EAAQsB,MAAOtB,EAAQuB,SAIvDC,EAAmBxB,EAAQqE,QAAQ,GAGnCrE,EAAQyE,SAAW1G,EAAU2G,cAAgB3G,EAAU0G,SACvDjD,EAAmBxB,EAAQyE,UAAU,IAIlCnG,EAAQO,cAAe,CAE1B,IADAmB,EAAQiD,WACHvD,EAAIZ,EAAec,OAAS,EAAGF,GAAK,EAAGA,IAC3C+D,EAAgB3E,EAAeY,GAC/BgE,GAAc,EACV7F,EAAOuF,cACVM,EAAcP,EAAaM,EAAcxE,SAC/BlB,EAAUkF,UACpBS,EAAcf,EAAac,EAAczE,UAEtC0E,IACH1D,EAAQiD,QAAQ0B,KAAKlB,EAAc1E,MACnCyC,EAAmBiC,EAAc1E,MAAM,GAGrChB,GAAU6G,gBACb5E,EAAQiD,QAAQ0B,KAAK,QACrBnD,EAAmB,QAAQ,KAiB9B,MAbA1D,GAAUwF,OAAS,SAASuB,GAC3B,MAAOvB,GAAOuB,IAEf/G,EAAUgH,KAAO,WACZhH,IAAcG,IACjBH,EAAUkC,SACTC,WAAYlC,EAAUkC,WAAalC,EAAUgH,QAAUlH,EAAOmH,OAAOC,eAEtEnH,EAAUwF,WAGZxF,EAAUgH,OAEHhH,GACNoH,KAAMA,KAAKnH,UAAWmH,KAAKlH"} \ No newline at end of file diff --git a/src/detectizr.js b/src/detectizr.js index 1329cbe..d7f52e3 100644 --- a/src/detectizr.js +++ b/src/detectizr.js @@ -55,6 +55,7 @@ window.Detectizr = (function(window, navigator, document, undefined) { resizeTimeoutId, oldOrientation; + // Create Global "extend" method, so Detectizr does not need jQuery.extend function extend(obj, extObj) { var a, b, i; if (arguments.length > 2) { @@ -127,24 +128,6 @@ window.Detectizr = (function(window, navigator, document, undefined) { } } - function checkOrientation() { - //timeout wrapper points with doResizeCode as callback - window.clearTimeout(resizeTimeoutId); - resizeTimeoutId = window.setTimeout(function() { - oldOrientation = Detectizr.device.orientation; - //wrapper for height/width check - if (window.innerHeight > window.innerWidth) { - Detectizr.device.orientation = "portrait"; - } else { - Detectizr.device.orientation = "landscape"; - } - addConditionalTest(Detectizr.device.orientation, true); - if (oldOrientation !== Detectizr.device.orientation) { - addConditionalTest(oldOrientation, false); - } - }, 10); - } - // add test to Modernizr based on a condition function addConditionalTest(feature, test) { if (!!feature && !!Modernizr) { @@ -185,10 +168,58 @@ window.Detectizr = (function(window, navigator, document, undefined) { } } + function checkOrientation() { + //timeout wrapper points with doResizeCode as callback + window.clearTimeout(resizeTimeoutId); + resizeTimeoutId = window.setTimeout(function() { + oldOrientation = Detectizr.device.orientation; + //wrapper for height/width check + if (window.innerHeight > window.innerWidth) { + Detectizr.device.orientation = "portrait"; + } else { + Detectizr.device.orientation = "landscape"; + } + addConditionalTest(Detectizr.device.orientation, true); + if (oldOrientation !== Detectizr.device.orientation) { + addConditionalTest(oldOrientation, false); + } + }, 10); + } + + function detectPlugin(substrs) { + var plugins = navigator.plugins, + plugin, haystack, pluginFoundText, j, k; + for (j = plugins.length - 1; j >= 0; j--) { + plugin = plugins[j]; + haystack = plugin.name + plugin.description; + pluginFoundText = 0; + for (k = substrs.length; k >= 0; k--) { + if (haystack.indexOf(substrs[k]) !== -1) { + pluginFoundText += 1; + } + } + if (pluginFoundText === substrs.length) { + return true; + } + } + return false; + } + + function detectObject(progIds) { + var j; + for (j = progIds.length - 1; j >= 0; j--) { + try { + new ActiveXObject(progIds[j]); + } catch (e) { + // Ignore + } + } + return false; + } + function detect(opt) { - // Create Global "extend" method, so Detectizr does not need jQuery.extend - var that = this, - i, j, k, device, os, browser, plugin2detect, pluginFound; + var i, j, device, os, browser, plugin2detect, pluginFound; + options = extend({}, options, opt || {}); /** Device detection **/ @@ -281,10 +312,24 @@ window.Detectizr = (function(window, navigator, document, undefined) { /** Screen detection **/ if (options.detectScreen) { + device.screen = {}; if (!!Modernizr && !!Modernizr.mq) { - addConditionalTest("smallScreen", Modernizr.mq("only screen and (max-width: 480px)")); - addConditionalTest("verySmallScreen", Modernizr.mq("only screen and (max-width: 320px)")); - addConditionalTest("veryVerySmallScreen", Modernizr.mq("only screen and (max-width: 240px)")); + if (Modernizr.mq("only screen and (max-width: 240px)")) { + device.screen.size = "veryVerySmall"; + addConditionalTest("veryVerySmallScreen", true); + } else if (Modernizr.mq("only screen and (max-width: 320px)")) { + device.screen.size = "verySmall"; + addConditionalTest("verySmallScreen", true); + } else if (Modernizr.mq("only screen and (max-width: 480px)")) { + device.screen.size = "small"; + addConditionalTest("smallScreen", true); + } + if (device.type === deviceTypes[1] || device.type === deviceTypes[2]) { + if (Modernizr.mq("only screen and (-moz-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)")) { + device.screen.resolution = "high"; + addConditionalTest("highresolution", true); + } + } } if (device.type === deviceTypes[1] || device.type === deviceTypes[2]) { window.onresize = function(event) { @@ -440,41 +485,13 @@ window.Detectizr = (function(window, navigator, document, undefined) { /** Plugin detection **/ if (options.detectPlugins) { browser.plugins = []; - that.detectPlugin = function(substrs) { - var plugins = navigator.plugins, - plugin, haystack, pluginFoundText; - for (j = plugins.length - 1; j >= 0; j--) { - plugin = plugins[j]; - haystack = plugin.name + plugin.description; - pluginFoundText = 0; - for (k = substrs.length; k >= 0; k--) { - if (haystack.indexOf(substrs[k]) !== -1) { - pluginFoundText += 1; - } - } - if (pluginFoundText === substrs.length) { - return true; - } - } - return false; - }; - that.detectObject = function(progIds) { - for (j = progIds.length - 1; j >= 0; j--) { - try { - new ActiveXObject(progIds[j]); - } catch (e) { - // Ignore - } - } - return false; - }; for (i = plugins2detect.length - 1; i >= 0; i--) { plugin2detect = plugins2detect[i]; pluginFound = false; if (window.ActiveXObject) { - pluginFound = that.detectObject(plugin2detect.progIds); + pluginFound = detectObject(plugin2detect.progIds); } else if (navigator.plugins) { - pluginFound = that.detectPlugin(plugin2detect.substrs); + pluginFound = detectPlugin(plugin2detect.substrs); } if (pluginFound) { browser.plugins.push(plugin2detect.name);