Skip to content

Commit

Permalink
Remove legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
typeofweb committed Mar 13, 2015
1 parent f9f7d51 commit 77ee31f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## uatools.js v2.0.0

### 2015.03.13
* All legacy code is removed, no more functions starting with capital letters

## uatools.js v1.0.0

### 2015.03.13
* Build script and minified version of the script are there

### 2015.03.11
* Bootstrap CSS file has been replaced with a minimal set of styles
* Functions names now respect a common JavaScript practice and all start with a lowercase letter (yet for compatibility reasons the old ones are still available)
* All string contacts are now exported in a form of _enum-like_ objects
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ uatools.js
A set of tools to help you analyse user agent strings. The intent is not to provide a tool to help sniffing user agent
but to help web developers to suggest right associated app based on right operating system.

You can try it live just [here](http://www.catuhe.com/uatools)
You can try it live here: https://mmiszy.github.io/uatools.js/

Once referenced, uatools.js allows you to call:
* uaTools.getOperatingSystem()
* uaTools.isMobile()
* uaTools.isTablet()

Feel free to contribute to get even more accurate results!

## Looking for older version?
Legacy version can be found on branch **version-1.0**.
17 changes: 0 additions & 17 deletions uatools.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,17 @@ var uaTools = (function (uaTools) {
Object.preventExtensions(uaTools.STORES);
}

function deprecated(newFunction) {
return function () {
if (console && console.warn) {
console.warn('This method is deprecated!');
}
return newFunction.call(this, arguments);
}
}

uaTools.isTablet = function () {
return currentLowerUA.indexOf("tablet") >= 0;
};
uaTools.IsTablet = deprecated(uaTools.isTablet);

uaTools.isMobile = function () {
return currentLowerUA.indexOf("mobile") >= 0;
};
uaTools.IsMobile = deprecated(uaTools.isMobile);

uaTools.getUserAgentString = function () {
return currentUA;
};
uaTools.GetUserAgentString = deprecated(uaTools.getUserAgentString);

uaTools.getStore = function () {
// Features testing first
Expand All @@ -76,7 +64,6 @@ var uaTools = (function (uaTools) {
return os;
}
};
uaTools.GetStore = deprecated(uaTools.getStore);

uaTools.getOperatingSystem = function () {
if (currentLowerUA.indexOf("windows phone") >= 0) {
Expand Down Expand Up @@ -133,10 +120,6 @@ var uaTools = (function (uaTools) {

return uaTools.OPERATING_SYSTEMS.UNKNOWN;
};
uaTools.GetOperatingSystem = deprecated(uaTools.getOperatingSystem);

return uaTools;
}(uaTools || {}));

//deprecated
var UATOOLS = uaTools;
2 changes: 1 addition & 1 deletion uatools.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 77ee31f

Please sign in to comment.