diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-09-14 14:36:13 -0400 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-09-14 14:36:13 -0400 |
| commit | 8d318ef588f10d1eb3a49c663373052f228c5680 (patch) | |
| tree | 409eae1c1e2a5882f5fb2ed652702f93ce6382ee /www/js/app.js | |
| parent | 6b5c7cf6c3ee67efe3ee7842c1e12c6902f7f31e (diff) | |
Added feature to pin lock app
Diffstat (limited to 'www/js/app.js')
| -rw-r--r-- | www/js/app.js | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/www/js/app.js b/www/js/app.js index b8cc0e8a..214e4f2d 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1,6 +1,6 @@ /* jshint -W041 */ /* jslint browser: true*/ -/* global cordova,StatusBar,angular,console */ +/* global cordova,StatusBar,angular,console,alert */ var appVersion = "0.0.0"; @@ -285,6 +285,8 @@ angular.module('zmApp', [ //console.log("**** ZM LOGIN SUCCESS INTERCEPT"); }); + + //------------------------------------------------------------------ // doLogin() is the function that tries to login to ZM @@ -483,7 +485,7 @@ angular.module('zmApp', [ $rootScope.toString = ""; $rootScope.loggedIntoZm = 0; - console.log ("HERE"); + //console.log ("HERE"); ZMDataModel.init(); // for making sure we canuse $state.go with ng-click // needed for views that use popovers @@ -546,7 +548,7 @@ angular.module('zmApp', [ $ionicPlatform.ready(function () { - + console.log("**** DEVICE READY ***"); // generates and error in desktops but works fine ZMDataModel.zmLog("Device is ready"); console.log("**** DEVICE READY ***"); @@ -563,6 +565,8 @@ angular.module('zmApp', [ }); + + //fileLogger is an excellent cross platform library // that allows you to manage log files without worrying about @@ -610,14 +614,25 @@ angular.module('zmApp', [ // so as a global hack I'm just reloading the current state if you switch // from foreground to background and back document.addEventListener("resume", function () { - console.log("****The application is resuming from the background"); - ZMDataModel.zmLog("App is resuming from background"); - $rootScope.rand = Math.floor((Math.random() * 100000) + 1); - //$scope.rand = Math.floor((Math.random() * 100000) + 1); - console.log("** generated Random of " + $rootScope.rand); - zmAutoLogin.stop(); //safety - zmAutoLogin.start(); - zmAutoLogin.doLogin("authenticating ..."); + ZMDataModel.zmLog("App is resuming from background"); + + $ionicSideMenuDelegate.toggleLeft(false); + ZMDataModel.validatePin() + .then ( function(data) + { + $rootScope.rand = Math.floor((Math.random() * 100000) + 1); + //$scope.rand = Math.floor((Math.random() * 100000) + 1); + console.log("** generated Random of " + $rootScope.rand); + zmAutoLogin.stop(); //safety + zmAutoLogin.start(); + zmAutoLogin.doLogin("authenticating ..."); + + }); + + + + + }, false); |
