1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Merge branch 'master' into make-testable-and-add-tests

Conflicts:
	bowser.js
	bowser.min.js
This commit is contained in:
BendingBender 2014-02-21 21:07:21 +01:00
commit b62ae3e233
5 changed files with 11 additions and 11 deletions

View File

@ -1,12 +1,12 @@
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2013
* MIT License | (c) Dustin Diaz 2014
*/
!function (name, definition) {
if (typeof define == 'function') define(definition)
else if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()
if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()
else if (typeof define == 'function') define(definition)
else this[name] = definition()
}('bowser', function () {
/**

4
bowser.min.js vendored
View File

@ -1,6 +1,6 @@
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2013
* MIT License | (c) Dustin Diaz 2014
*/
!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"&&module.exports?module.exports.browser=t():this[e]=t()}("bowser",function(){function n(e,t,n){var r=e.match(t);return r&&r.length>n&&r[n]||0}function r(r){var i=/(msie|trident)/i.test(r),s=/chrome|crios/i.test(r),o=/phantom/i.test(r),u=/iphone/i.test(r),a=/ipad/i.test(r),f=/ipod/i.test(r),l=/touchpad/i.test(r),c=/silk/i.test(r),h=/safari/i.test(r)&&!s&&!o&&!c,p=/android/i.test(r),d=/opera/i.test(r)||/opr/i.test(r),m=/firefox/i.test(r),g=/gecko\//i.test(r),y=/seamonkey\//i.test(r),b=/webos/i.test(r),w=/windows phone/i.test(r),E=/blackberry/i.test(r),S=/version\/(\d+(\.\d+)?)/i,x=/firefox[ \/](\d+(\.\d+)?)/i,T={};f&&(u=!1);if(w)T={name:"Windows Phone",windowsphone:e,msie:e,mobile:e,version:n(r,/iemobile\/(\d+(\.\d+)?)/i,1)};else if(d)t=n(r,S,1)||n(r,/opr\/(\d+(\.\d+)?)/i,1)||n(r,/opera[ \/](\d+(\.\d+)?)/i,1),T={name:"Opera",opera:e,version:t},p&&(T.android=e,T.mobile=e),s&&(T.webkit=e);else if(i)T={name:"Internet Explorer",msie:e,version:n(r,/(msie |rv:)(\d+(\.\d+)?)/i,2)};else if(s){T={name:"Chrome",webkit:e,chrome:e,version:n(r,/(?:chrome|crios)\/(\d+(\.\d+)?)/i,1)},p&&(T.android=e);if(a||f||u)T[u?"iphone":a?"ipad":"ipod"]=e,T.ios=e;if(T.android||T.ios)T.mobile=e}else o?T={name:"PhantomJS",webkit:e,phantom:e,version:n(r,/phantomjs\/(\d+(\.\d+)?)/i,1)}:l?T={name:"TouchPad",webkit:e,touchpad:e,version:n(r,/touchpad\/(\d+(\.\d+)?)/i,1)}:c?T={name:"Amazon Silk",webkit:e,android:e,mobile:e,version:n(r,/silk\/(\d+(\.\d+)?)/i,1)}:u||a||f?(T={name:u?"iPhone":a?"iPad":"iPod",webkit:e,mobile:e,ios:e},T[u?"iphone":a?"ipad":"ipod"]=e,S.test(r)&&(T.version=n(r,S,1))):E?(T={name:"BlackBerry",blackberry:e,mobile:e},(t=n(r,S,1))?(T.version=t,T.webkit=e):T.version=n(r,/blackberry[\d]+\/(\d+(\.\d+)?)/i,1)):b?T={name:"WebOS",mobile:e,webkit:e,webos:e,version:n(r,S,1)||n(r,/wosbrowser\/(\d+(\.\d+)?)/i,1)}:g?(T={name:"Gecko",gecko:e,mozilla:e,version:n(r,x,1)},y?(T.name="SeaMonkey",T.seamonkey=e,T.version=n(r,/seamonkey\/(\d+(\.\d+)?)/i,1)):m&&(T.name="Firefox",T.firefox=e),p?(T.android=e,T.mobile=e):!p&&m&&/\((mobile|tablet);.*rv:[\d\.]+\)/i.test(r)&&(T.firefoxos=e,T.mobile=e)):p?T={name:"Android",webkit:e,android:e,mobile:e,version:n(r,S,1)}:h&&(T={name:"Safari",webkit:e,safari:e,version:n(r,S,1)});var N;return p?(N=n(r,/android[ \/](\d+(\.\d+)*)/i,1),N&&(T.osversion=N)):u||a||f?(N=n(r,/os (\d+([_\s]\d+)*) like mac os x/i,1),N&&(T.osversion=N.replace(/[_\s]/g,"."))):w&&(N=n(r,/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,1),N&&(T.osversion=N)),T.msie&&T.version>=9||T.chrome&&T.version>=20||T.firefox&&T.version>=10||T.safari&&T.version>=5||T.opera&&T.version>=10||T.ios&&T.osversion&&T.osversion.split(".")[0]>=6?T.a=e:T.msie&&T.version<9||T.chrome&&T.version<20||T.firefox&&T.version<10||T.safari&&T.version<5||T.opera&&T.version<10||T.ios&&T.osversion&&T.osversion.split(".")[0]<6?T.c=e:T.x=e,T}var e=!0,t,i=r(typeof navigator!="undefined"?navigator.userAgent:"");return i._detect=r,i})
!function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"?define(t):this[e]=t()}("bowser",function(){function n(e,t,n){var r=e.match(t);return r&&r.length>n&&r[n]||0}function r(r){var i=/(msie|trident)/i.test(r),s=/chrome|crios/i.test(r),o=/phantom/i.test(r),u=/iphone/i.test(r),a=/ipad/i.test(r),f=/ipod/i.test(r),l=/touchpad/i.test(r),c=/silk/i.test(r),h=/safari/i.test(r)&&!s&&!o&&!c,p=/android/i.test(r),d=/opera/i.test(r)||/opr/i.test(r),m=/firefox/i.test(r),g=/gecko\//i.test(r),y=/seamonkey\//i.test(r),b=/webos/i.test(r),w=/windows phone/i.test(r),E=/blackberry/i.test(r),S=/version\/(\d+(\.\d+)?)/i,x=/firefox[ \/](\d+(\.\d+)?)/i,T={};f&&(u=!1);if(w)T={name:"Windows Phone",windowsphone:e,msie:e,mobile:e,version:n(r,/iemobile\/(\d+(\.\d+)?)/i,1)};else if(d)t=n(r,S,1)||n(r,/opr\/(\d+(\.\d+)?)/i,1)||n(r,/opera[ \/](\d+(\.\d+)?)/i,1),T={name:"Opera",opera:e,version:t},p&&(T.android=e,T.mobile=e),s&&(T.webkit=e);else if(i)T={name:"Internet Explorer",msie:e,version:n(r,/(msie |rv:)(\d+(\.\d+)?)/i,2)};else if(s){T={name:"Chrome",webkit:e,chrome:e,version:n(r,/(?:chrome|crios)\/(\d+(\.\d+)?)/i,1)},p&&(T.android=e);if(a||f||u)T[u?"iphone":a?"ipad":"ipod"]=e,T.ios=e;if(T.android||T.ios)T.mobile=e}else o?T={name:"PhantomJS",webkit:e,phantom:e,version:n(r,/phantomjs\/(\d+(\.\d+)?)/i,1)}:l?T={name:"TouchPad",webkit:e,touchpad:e,version:n(r,/touchpad\/(\d+(\.\d+)?)/i,1)}:c?T={name:"Amazon Silk",webkit:e,android:e,mobile:e,version:n(r,/silk\/(\d+(\.\d+)?)/i,1)}:u||a||f?(T={name:u?"iPhone":a?"iPad":"iPod",webkit:e,mobile:e,ios:e},T[u?"iphone":a?"ipad":"ipod"]=e,S.test(r)&&(T.version=n(r,S,1))):E?(T={name:"BlackBerry",blackberry:e,mobile:e},(t=n(r,S,1))?(T.version=t,T.webkit=e):T.version=n(r,/blackberry[\d]+\/(\d+(\.\d+)?)/i,1)):b?T={name:"WebOS",mobile:e,webkit:e,webos:e,version:n(r,S,1)||n(r,/wosbrowser\/(\d+(\.\d+)?)/i,1)}:g?(T={name:"Gecko",gecko:e,mozilla:e,version:n(r,x,1)},y?(T.name="SeaMonkey",T.seamonkey=e,T.version=n(r,/seamonkey\/(\d+(\.\d+)?)/i,1)):m&&(T.name="Firefox",T.firefox=e),p?(T.android=e,T.mobile=e):!p&&m&&/\((mobile|tablet);.*rv:[\d\.]+\)/i.test(r)&&(T.firefoxos=e,T.mobile=e)):p?T={name:"Android",webkit:e,android:e,mobile:e,version:n(r,S,1)}:h&&(T={name:"Safari",webkit:e,safari:e,version:n(r,S,1)});var N;return p?(N=n(r,/android[ \/](\d+(\.\d+)*)/i,1),N&&(T.osversion=N)):u||a||f?(N=n(r,/os (\d+([_\s]\d+)*) like mac os x/i,1),N&&(T.osversion=N.replace(/[_\s]/g,"."))):w&&(N=n(r,/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,1),N&&(T.osversion=N)),T.msie&&T.version>=9||T.chrome&&T.version>=20||T.firefox&&T.version>=10||T.safari&&T.version>=5||T.opera&&T.version>=10||T.ios&&T.osversion&&T.osversion.split(".")[0]>=6?T.a=e:T.msie&&T.version<9||T.chrome&&T.version<20||T.firefox&&T.version<10||T.safari&&T.version<5||T.opera&&T.version<10||T.ios&&T.osversion&&T.osversion.split(".")[0]<6?T.c=e:T.x=e,T}var e=!0,t,i=r(typeof navigator!="undefined"?navigator.userAgent:"");return i._detect=r,i})

View File

@ -7,7 +7,7 @@
"sniff",
"detection"
],
"version": "0.3.9",
"version": "0.4.0",
"homepage": "https://github.com/ded/bowser",
"author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)",
"main": "./bowser.js",
@ -16,7 +16,7 @@
"url": "https://github.com/ded/bowser.git"
},
"devDependencies": {
"smoosh": "*"
, "mocha": "*"
"smoosh": "*",
"mocha": "*"
}
}

View File

@ -1,6 +1,6 @@
!function (name, definition) {
if (typeof define == 'function') define(definition)
else if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()
if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()
else if (typeof define == 'function') define(definition)
else this[name] = definition()
}('bowser', function () {
/**

View File

@ -1,5 +1,5 @@
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2013
* MIT License | (c) Dustin Diaz 2014
*/