From 8bf3f97b2706ce02a296173b4135dd9d69b66bde Mon Sep 17 00:00:00 2001 From: Nicholas Thomson Date: Tue, 18 Mar 2014 23:30:52 -0400 Subject: [PATCH] Missing file --- app/scripts/services/isMobile.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/scripts/services/isMobile.js diff --git a/app/scripts/services/isMobile.js b/app/scripts/services/isMobile.js new file mode 100644 index 0000000..02ad255 --- /dev/null +++ b/app/scripts/services/isMobile.js @@ -0,0 +1,28 @@ +'use strict'; + +angular.module('crunchinatorApp.services').service('IsMobile', [function() { + + + var isMobile = { + Android: function() { + return navigator.userAgent.match(/Android/i); + }, + BlackBerry: function() { + return navigator.userAgent.match(/BlackBerry/i); + }, + iOS: function() { + return navigator.userAgent.match(/iPhone|iPad|iPod/i); + }, + Opera: function() { + return navigator.userAgent.match(/Opera Mini/i); + }, + Windows: function() { + return navigator.userAgent.match(/IEMobile/i); + }, + any: function() { + return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); + } + }; + + return isMobile; +}]);