Revisions
-
dpesch revised this gist
Jun 4, 2013 . 2 changed files with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ /vendor/ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ { "name": "tvandervossen/detect.js", "description": "environment / user agent / device / feature detection code", "authors": [ { "name": "Thijs van der Vossen", "email": "[email protected]" } ] } -
tvandervossen revised this gist
Feb 5, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ env = function(){ var flags = {}, ua = navigator.userAgent, el = document.createElement('div'), root = document.documentElement, i function flag(names) { root.className += (root.className ? ' ' : '') + names @@ -17,5 +17,6 @@ device = function(){ if (window.navigator.standalone) flag('standalone') if (window.devicePixelRatio >= 2) flag('retina') if (window !== window.top) flag('embedded') if (!!document.createElement('video').canPlayType) flag('video') return flags }() -
tvandervossen created this gist
Jan 26, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ device = function(){ var flags = {}, ua = navigator.userAgent, el = document.createElement('div'), root = document.documentElement, i function flag(names) { root.className += (root.className ? ' ' : '') + names names = names.split(' ') for (i = 0; i < names.length; i++) flags[names[i]] = true } if (ua.indexOf('WebKit/') > -1) flag('webkit') if (ua.indexOf('MSIE ') > -1) flag('msie') if (ua.indexOf('Firefox') > -1) flag('firefox') if (ua.indexOf('(iPad') > -1) flag('ios ipad') if (ua.indexOf('(iPhone') > -1 || ua.indexOf('(iPod') > 1) flag('ios iphone') if (!flags.ios) flag('desktop') el.setAttribute('ontouchstart', 'return;') if (typeof el.ontouchstart === 'function') flag('touch') if (window.navigator.msPointerEnabled) flag('touch mspointer') if (window.navigator.standalone) flag('standalone') if (window.devicePixelRatio >= 2) flag('retina') if (window !== window.top) flag('embedded') return flags }()