diff options
Diffstat (limited to 'www/js/app.js')
| -rw-r--r-- | www/js/app.js | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/www/js/app.js b/www/js/app.js index e8ac220e..463e15d4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -10,10 +10,6 @@ angular.module('zmApp', [ ]) - - - - // this directive will be load any time an image completes loading // via img tags where this directive is added (I am using this in // events and mionitor view to show a loader while the image is @@ -34,8 +30,6 @@ angular.module('zmApp', [ }) - - // In Android, HTTP requests seem to get stuck once in a while // It may be a crosswalk issue. // To tackle this gracefully, I've set up a global interceptor @@ -66,6 +60,7 @@ angular.module('zmApp', [ }; }) +// This service automatically logs into ZM at periodic intervals .factory('zmAutoLogin', function($interval, ZMDataModel, $http) { var zmAutoLoginHandle; function doLogin() @@ -158,7 +153,8 @@ angular.module('zmApp', [ -.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin) { +.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin) +{ ZMDataModel.init(); var loginData = ZMDataModel.getLogin(); @@ -169,7 +165,6 @@ angular.module('zmApp', [ } - // this works reliably on both Android and iOS. The "onorientation" seems to reverse w/h in Android. Go figure. // http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript @@ -246,9 +241,6 @@ angular.module('zmApp', [ }, false); - - - if (window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); } @@ -258,17 +250,14 @@ angular.module('zmApp', [ } - }); + }); //platformReady // lets POST so we get a session ID right hre - // var loginData = ZMDataModel.getLogin(); console.log ("Setting up POST LOGIN timer"); zmAutoLogin.start(); - - }) //run // My route map connecting menu options to their respective templates and controllers @@ -287,8 +276,6 @@ angular.module('zmApp', [ url: "/login", templateUrl: "templates/login.html", controller: 'zmApp.LoginCtrl', - - }); $stateProvider @@ -299,8 +286,6 @@ angular.module('zmApp', [ url: "/help", templateUrl: "templates/help.html", controller: 'zmApp.HelpCtrl', - - }) .state('monitors', { @@ -319,7 +304,6 @@ angular.module('zmApp', [ }) - .state('events', { data: { requireLogin: true @@ -336,7 +320,6 @@ angular.module('zmApp', [ }) - //n .state('events-graphs', { data: { requireLogin: true @@ -355,7 +338,6 @@ angular.module('zmApp', [ controller: 'zmApp.StateCtrl', }) - .state('devoptions', { data: { requireLogin: true @@ -365,8 +347,6 @@ angular.module('zmApp', [ controller: 'zmApp.DevOptionsCtrl', }) - - .state('montage', { data: { requireLogin: true @@ -385,7 +365,6 @@ angular.module('zmApp', [ }); - // if none of the above states are matched, use this as the fallback var defaultState = "/montage"; //var defaultState = "/login"; @@ -404,4 +383,4 @@ angular.module('zmApp', [ $state.go("montage"); }); -}); +}); //config |
