Skip to content

Commit

Permalink
update with Mobile-Detect commit cf8f99c1575e; version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hgoebl committed Apr 30, 2014
1 parent 59d51ee commit 7f67b44
Show file tree
Hide file tree
Showing 7 changed files with 1,261 additions and 664 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ You can easily extend it, e.g. `android`, `iphone`, etc.

## Size (bytes)

* development: 48.183
* minified: 24.304
* minified + gzipped: 10.335 (`cat mobile-detect.min.js | gzip -9f | wc -c`)
* development: 53.412
* minified: 28.669
* minified + gzipped: 12.224 (`cat mobile-detect.min.js | gzip -9f | wc -c`)

# Installation

Expand All @@ -90,7 +90,7 @@ You can easily extend it, e.g. `android`, `iphone`, etc.

## CDN - [jsDelivr](http://www.jsdelivr.com/#!mobile-detect.js)

<script src="//cdn.jsdelivr.net/mobile-detect.js/0.1.1/mobile-detect.min.js"></script>
<script src="//cdn.jsdelivr.net/mobile-detect.js/0.2.0/mobile-detect.min.js"></script>

# Alternatives / Infos

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobile-detect",
"version": "0.1.1",
"version": "0.2.0",
"description": "Device detection (phone, tablet, desktop, mobile grade, os, versions)",
"homepage": "http://hgoebl.github.io/mobile-detect.js/",
"keywords": [
Expand Down
68 changes: 36 additions & 32 deletions generate/mobile-detect.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,41 +417,41 @@

if (
// Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1)
t.version('iPad') >= 4.3 ||
t.version('iPhone') >= 3.1 ||
t.version('iPod') >= 3.1 ||
t.version('iPad')>=4.3 ||
t.version('iPhone')>=3.1 ||
t.version('iPod')>=3.1 ||

// Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)
// Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM
// Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices
// Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7
( t.version('Android') > 2.1 && t.is('Webkit') ) ||
( t.version('Android')>2.1 && t.is('Webkit') ) ||

// Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800
t.version('Windows Phone OS') >= 7.0 ||
t.version('Windows Phone OS')>=7.0 ||

// Blackberry 7 - Tested on BlackBerry® Torch 9810
// Blackberry 6.0 - Tested on the Torch 9800 and Style 9670
t.is('BlackBerry') && t.version('BlackBerry') >= 6.0 ||
t.is('BlackBerry') && t.version('BlackBerry')>=6.0 ||
// Blackberry Playbook (1.0-2.0) - Tested on PlayBook
t.match('Playbook.*Tablet') ||

// Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0)
( t.version('webOS') >= 1.4 && t.match('Palm|Pre|Pixi') ) ||
( t.version('webOS')>=1.4 && t.match('Palm|Pre|Pixi') ) ||
// Palm WebOS 3.0 - Tested on HP TouchPad
t.match('hp.*TouchPad') ||

// Firefox Mobile (12 Beta) - Tested on Android 2.3 device
( t.is('Firefox') && t.version('Firefox') >= 12 ) ||
( t.is('Firefox') && t.version('Firefox')>=12 ) ||

// Chrome for Android - Tested on Android 4.0, 4.1 device
( t.is('Chrome') && t.is('AndroidOS') && t.version('Android') >= 4.0 ) ||
( t.is('Chrome') && t.is('AndroidOS') && t.version('Android')>=4.0 ) ||

// Skyfire 4.1 - Tested on Android 2.3 device
( t.is('Skyfire') && t.version('Skyfire') >= 4.1 && t.is('AndroidOS') && t.version('Android') >= 2.3 ) ||
( t.is('Skyfire') && t.version('Skyfire')>=4.1 && t.is('AndroidOS') && t.version('Android')>=2.3 ) ||

// Opera Mobile 11.5-12: Tested on Android 2.3
( t.is('Opera') && t.version('Opera Mobi') > 11 && t.is('AndroidOS') ) ||
( t.is('Opera') && t.version('Opera Mobi')>11 && t.is('AndroidOS') ) ||

// Meego 1.2 - Tested on Nokia 950 and N9
t.is('MeeGoOS') ||
Expand All @@ -461,67 +461,71 @@

// Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser
// @todo: more tests here!
t.is('Dolfin') && t.version('Bada') >= 2.0 ||
t.is('Dolfin') && t.version('Bada')>=2.0 ||

// UC Browser - Tested on Android 2.3 device
( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android') >= 2.3 ) ||
( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android')>=2.3 ) ||

// Kindle 3 and Fire - Tested on the built-in WebKit browser for each
( t.match('Kindle Fire') ||
t.is('Kindle') && t.version('Kindle') >= 3.0 ) ||
t.is('Kindle') && t.version('Kindle')>=3.0 ) ||

// Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet
t.is('AndroidOS') && t.is('NookTablet') ||

// Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7
t.version('Chrome') >= 11 && !$isMobile ||
t.version('Chrome')>=11 && !$isMobile ||

// Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7
t.version('Safari') >= 5.0 && !$isMobile ||
t.version('Safari')>=5.0 && !$isMobile ||

// Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7
t.version('Firefox') >= 4.0 && !$isMobile ||
t.version('Firefox')>=4.0 && !$isMobile ||

// Internet Explorer 7-9 - Tested on Windows XP, Vista and 7
t.version('MSIE') >= 7.0 && !$isMobile ||
t.version('MSIE')>=7.0 && !$isMobile ||

// Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7
// @reference: http://my.opera.com/community/openweb/idopera/
t.version('Opera') >= 10 && !$isMobile
) {
t.version('Opera')>=10 && !$isMobile

){
return 'A';
}

if (
t.version('iPad') < 4.3 ||
t.version('iPhone') < 3.1 ||
t.version('iPod') < 3.1 ||
t.version('iPad')<4.3 ||
t.version('iPhone')<3.1 ||
t.version('iPod')<3.1 ||

// Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770
t.is('Blackberry') && t.version('BlackBerry') >= 5 && t.version('BlackBerry') < 6 ||
t.is('Blackberry') && t.version('BlackBerry')>=5 && t.version('BlackBerry')<6 ||

//Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3
( t.version('Opera Mini') >= 5.0 && t.version('Opera Mini') <= 6.5 &&
(t.version('Android') >= 2.3 || t.is('iOS')) ) ||
( t.version('Opera Mini')>=5.0 && t.version('Opera Mini')<=6.5 &&
(t.version('Android')>=2.3 || t.is('iOS')) ) ||

// Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)
t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||

// @todo: report this (tested on Nokia N71)
t.version('Opera Mobi') >= 11 && t.is('SymbianOS')
) {
t.version('Opera Mobi')>=11 && t.is('SymbianOS')
){
return 'B';
}

if (
// Blackberry 4.x - Tested on the Curve 8330
t.version('BlackBerry') < 5.0 ||
// Blackberry 4.x - Tested on the Curve 8330
t.version('BlackBerry')<5.0 ||
// Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile') <= 5.2
) {
t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile')<=5.2

){
return 'C';
}

//All older smartphone platforms and featurephones - Any device that doesn't support media queries
//will receive the basic, C grade experience.
return 'C';
}
};
Expand Down
Loading

0 comments on commit 7f67b44

Please sign in to comment.