update 0.7.14

This commit is contained in:
Faisal Salman 2017-09-05 13:24:19 +07:00
parent e20b78fa6a
commit b8b39dcfd2
2 changed files with 24 additions and 19 deletions

View File

@ -7,18 +7,18 @@
<meta name="description" content="UAParser.js Lightweight JavaScript-based User-Agent string parser. Supports browser & node.js environment. Also available as jQuery plugin & AMD module." />
<meta name="keywords" content="user agent, parser, javascript, detect, details, new, browser, engine, mobile, device, operating system" />
<style>
@import url("//fonts.googleapis.com/css?family=Raleway");
@import url("https://fonts.googleapis.com/css?family=Kalam");
* {
margin: 0;
padding: 0;
font-family: Raleway, Helvetica, Ubuntu, Arial, Georgia, sans-serif;
font-family: Kalam, Helvetica, Ubuntu, Arial, Georgia, sans-serif;
}
html, input, select {
font: 14px/20px Helvetica, Ubuntu, Arial, Georgia, sans-serif;
color: #333;
}
body {
background: #33A6B2;
background: #548796;
margin: 0 auto;
width: 960px;
text-align: center;
@ -29,17 +29,17 @@
}
header {
padding: 100px 50px 50px;
background-color: #196674;
background-color: #2A4149;
color: #fff;
}
section {
background-color: #F0F0F0;
background-color: #E3F0C6;
}
section.test {
background-color: #218777;
background-color: #ACCBB5;
}
footer {
background-color: #33332D;
background-color: #FE6B44;
color: #fff;
}
footer a {

View File

@ -874,7 +874,7 @@
/////////////////
// Constructor
////////////////
/*
var Browser = function (name, version) {
this[NAME] = name;
this[VERSION] = version;
@ -889,7 +889,7 @@
};
var Engine = Browser;
var OS = Browser;
*/
var UAParser = function (uastring, extensions) {
if (typeof uastring === 'object') {
@ -903,30 +903,35 @@
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
var browser = new Browser();
var cpu = new CPU();
var device = new Device();
var engine = new Engine();
var os = new OS();
//var browser = new Browser();
//var cpu = new CPU();
//var device = new Device();
//var engine = new Engine();
//var os = new OS();
this.getBrowser = function () {
var browser = { name: undefined, version: undefined };
mapper.rgx.call(browser, ua, rgxmap.browser);
browser.major = util.major(browser.version); // deprecated
return browser;
};
this.getCPU = function () {
var cpu = { architecture: undefined };
mapper.rgx.call(cpu, ua, rgxmap.cpu);
return cpu;
};
this.getDevice = function () {
var device = { vendor: undefined, model: undefined, type: undefined };
mapper.rgx.call(device, ua, rgxmap.device);
return device;
};
this.getEngine = function () {
var engine = { name: undefined, version: undefined };
mapper.rgx.call(engine, ua, rgxmap.engine);
return engine;
};
this.getOS = function () {
var os = { name: undefined, version: undefined };
mapper.rgx.call(os, ua, rgxmap.os);
return os;
};
@ -945,11 +950,11 @@
};
this.setUA = function (uastring) {
ua = uastring;
browser = new Browser();
cpu = new CPU();
device = new Device();
engine = new Engine();
os = new OS();
//browser = new Browser();
//cpu = new CPU();
//device = new Device();
//engine = new Engine();
//os = new OS();
return this;
};
return this;