This commit is contained in:
Faisal Salman 2014-11-20 07:15:18 +07:00
parent d5cf025713
commit e725633328
2 changed files with 17 additions and 4 deletions

View File

@ -55,6 +55,8 @@
has : function (str1, str2) { has : function (str1, str2) {
if (typeof str1 === "string") { if (typeof str1 === "string") {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
} else {
return false;
} }
}, },
lowerize : function (str) { lowerize : function (str) {
@ -513,10 +515,10 @@
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [ ], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
// Motorola // Motorola
/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,
/(mot)[\s-]?(\w+)*/i, /mot[\s-]?(\w+)*/i,
/XT\d{3,4} build\//i /(XT\d{3,4}) build\//i
], [[VENDOR, 'Motorola'], MODEL, [TYPE, MOBILE]], [ ], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i /android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [ ], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [
@ -696,6 +698,7 @@
return this; return this;
}; };
this.setUA(ua); this.setUA(ua);
return this;
}; };
UAParser.VERSION = LIBVERSION; UAParser.VERSION = LIBVERSION;

View File

@ -59,6 +59,16 @@
"type" : "mobile" "type" : "mobile"
} }
}, },
{
"desc" : "Moto X",
"ua" : "Mozilla/5.0 (Linux; U; Android 4.2; xx-xx; XT1058 Build/13.9.0Q2.X-70-GHOST-ATT_LE-2) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
"expect" :
{
"vendor" : "Motorola",
"model" : "XT1058",
"type" : "mobile"
}
},
{ {
"desc" : "Nokia3xx", "desc" : "Nokia3xx",
"ua" : "Nokia303/14.87 CLDC-1.1", "ua" : "Nokia303/14.87 CLDC-1.1",