Skip to content

Commit

Permalink
v1.3.4 use Mobile-Detect@2.8.23
Browse files Browse the repository at this point in the history
  • Loading branch information
hgoebl committed Nov 11, 2016
1 parent 8d8a2cf commit f9bc265
Show file tree
Hide file tree
Showing 12 changed files with 1,395 additions and 1,258 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tests
.jshintrc
Gruntfile.js
bower.json
generate
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.3.4:
date: 2016-11-11
changes:
- use Mobile-Detect@2.8.23
- add typings for TypeScript

v1.3.3:
date: 2016-07-31
changes:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can find out information about the device rendering your web page:
* [Mobile Grade (A, B, C)](http://jquerymobile.com/gbs/)
* specific versions (e.g. WebKit)

Current `master` branch is using detection logic from **Mobile-Detect@2.8.22**
Current `master` branch is using detection logic from **Mobile-Detect@2.8.23**

# Live Demo

Expand Down Expand Up @@ -104,9 +104,9 @@ You can easily extend it, e.g. `android`, `iphone`, etc.

## Size (bytes)

* development: 67441
* minified: 37409
* minified + gzipped: 15615 (`cat mobile-detect.min.js | gzip -9f | wc -c`)
* development: 67645
* minified: 37558
* minified + gzipped: 15673 (`cat mobile-detect.min.js | gzip -9f | wc -c`)

# Installation

Expand All @@ -120,11 +120,11 @@ 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/1.3.3/mobile-detect.min.js"></script>
<script src="//cdn.jsdelivr.net/mobile-detect.js/1.3.4/mobile-detect.min.js"></script>

## cdnjs - [cdnjs.com](https://cdnjs.com/libraries/mobile-detect)

<script src="//cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.3.3/mobile-detect.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.3.4/mobile-detect.min.js"></script>

# Extending/Modifying Behaviour

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": "1.3.3",
"version": "1.3.4",
"description": "Device detection (phone, tablet, desktop, mobile grade, os, versions)",
"homepage": "http://hgoebl.github.io/mobile-detect.js/",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions generate/mobile-detect.template.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*global module:false, define:false*/
/*jshint latedef:false*/
/*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/
(function (define, undefined) {
define(function () {
Expand Down
64 changes: 64 additions & 0 deletions mobile-detect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

export interface MobileDetectRules {
[key: string]: string|RegExp;
}

export interface MobileDetectComplexRules {
[key: string]: string|RegExp|string[]|RegExp[];
}

export interface MobileDetectImpl {
mobileDetectRules: {
phones: MobileDetectRules;
tablets: MobileDetectRules;
oss: MobileDetectRules;
uas: MobileDetectRules;
props: MobileDetectComplexRules;
utils: MobileDetectRules;
};
detectMobileBrowsers: {
fullPattern: RegExp;
shortPattern: RegExp;
tabletPattern: RegExp;
};
FALLBACK_PHONE: string;
FALLBACK_TABLET: string;
FALLBACK_MOBILE: string;

findMatch(rules: MobileDetectRules, userAgent: string): string;
findMatches(rules: MobileDetectRules, userAgent: string): string[];
getVersionStr(propertyName: string, userAgent: string): string;
getVersion(propertyName: string, userAgent: string): number;
prepareVersionNo(version: string): number;
isMobileFallback(userAgent: string): boolean;
isTabletFallback(userAgent: string): boolean;
prepareDetectionCache(cache: Object, userAgent: string, maxPhoneWidth?: number): void;
mobileGrade(md: MobileDetect): string;
detectOS(userAgent: string): string;
getDeviceSmallerSide(): number;
}

export declare class MobileDetect {
static version: string;
static isPhoneSized(maxPhoneWidth?: number): boolean;
// only used internally; if necessary, one can replace, intercept or augment particular methods or values
static _impl: MobileDetectImpl;

constructor(userAgent: string, maxPhoneWidth?: number);

mobile(): string;
phone(): string;
tablet(): string;

userAgent(): string;
userAgents(): string[];
os(): string;

version(value: string): number;
versionStr(value: string): string;

is(key: string): boolean;
match(pattern: string|RegExp): boolean;
isPhoneSized(maxPhoneWidth?: number): boolean;
mobileGrade(): string;
}
50 changes: 27 additions & 23 deletions mobile-detect.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions mobile-detect.js.iml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Node.js Dependencies for mobile-detect.js" level="project" />
</component>
</module>

</module>
6 changes: 3 additions & 3 deletions mobile-detect.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "mobile-detect",
"version": "1.3.3",
"version": "1.3.4",
"description": "Device detection (phone, tablet, desktop, mobile grade, os, versions)",
"main": "mobile-detect.js",
"typings": "mobile-detect",
"scripts": {
"test": "grunt jasmine_node"
},
Expand Down
Loading

0 comments on commit f9bc265

Please sign in to comment.