diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/EventServer.js | 6 | ||||
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 97 | ||||
| -rwxr-xr-x | www/js/app.js | 102 |
3 files changed, 108 insertions, 97 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js index e3febfb6..c09ad7ee 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -583,7 +583,7 @@ angular.module('zmApp.controllers') // set tappedMid to monitor //*** PUSH DATA>>>>{"sound":"blop","message":"Alarms: Basement (2854) ","additionalData":{"mid":"2","coldstart":false,"collapse_key":"do_not_collapse","foreground":false}} - if (data.additionalData.dismissed != undefined) // user tapped on notification + if (data.additionalData.dismissed != undefined || data.additionalData.coldstart == true) // user tapped on notification { NVRDataModel.debug("Notification Tapped"); $rootScope.alarmCount = "0"; @@ -622,7 +622,7 @@ angular.module('zmApp.controllers') $rootScope.tappedEid = 0; $rootScope.tappedMid = 0; } - + $rootScope.$emit('process-push'); } else // app is foreground @@ -631,7 +631,7 @@ angular.module('zmApp.controllers') // this flag honors the HW mute button. Go figure // http://ilee.co.uk/phonegap-plays-sound-on-mute/ - NVRDataModel.debug ("--> Either app icon tapped, or app is already in foreground"); + NVRDataModel.debug ("--> *** PUSH IN FOREGROUND"); $rootScope.tappedNotification = 0; $rootScope.tappedEid = 0; diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index a7d25f84..838d107e 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -267,98 +267,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic return (d.promise); } - function evaluateTappedNotification() - { - var ld = NVRDataModel.getLogin(); - - - if ($rootScope.tappedNotification == 2) { // url launch - NVRDataModel.debug("Came via app url launch with mid="+$rootScope.tappedMid); - NVRDataModel.debug("Came via app url launch with eid="+$rootScope.tappedEid); - $rootScope.tappedNotification = 0; - $ionicHistory.nextViewOptions( - { - disableBack: true - }); - - if (parseInt($rootScope.tappedMid) > 0) - { - NVRDataModel.debug("Going to live view "); - $state.go("app.monitors", - {}, - { - reload: true - }); - return; - - } - - else if (parseInt($rootScope.tappedEid) > 0) { - NVRDataModel.debug("Going to events with EID=" + $rootScope.tappedEid); - $state.go("app.events", - { - //"id": $rootScope.tappedEid, - "id": 0, - "playEvent": true - }, - { - reload: true - }); - return; - } - // go with monitor first, then event - just because I feel like ;) - - - } - else if ($rootScope.tappedNotification == 1) // push - { - - - NVRDataModel.log("Came via push tap. onTapScreen=" + ld.onTapScreen); - //console.log ("***** NOTIFICATION TAPPED "); - $rootScope.tappedNotification = 0; - $ionicHistory.nextViewOptions( - { - disableBack: true - }); - - if (ld.onTapScreen == $translate.instant('kTapMontage')) - { - NVRDataModel.debug("Going to montage"); - $state.go("app.montage", - {}, - { - reload: true - }); - - return; - } - else if (ld.onTapScreen == $translate.instant('kTapEvents')) - { - NVRDataModel.debug("Going to events"); - $state.go("app.events", - { - "id": 0, - "playEvent": false - }, - { - reload: true - }); - return; - } - else // we go to live - { - NVRDataModel.debug("Going to live view "); - $state.go("app.monitors", - {}, - { - reload: true - }); - return; - } - } - - } + function unlock(idVerified) { @@ -442,8 +351,8 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic return; } - else - evaluateTappedNotification(); + //else + // evaluateTappedNotification(); }, diff --git a/www/js/app.js b/www/js/app.js index cf608567..020650d1 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -860,6 +860,108 @@ angular.module('zmApp', [ return; }); + + + $rootScope.$on("process-push", function () { + NVRDataModel.debug("*** PROCESS PUSH HANDLER CALLED"); + evaluateTappedNotification(); + }); + + function evaluateTappedNotification() + { + var ld = NVRDataModel.getLogin(); + + + if ($rootScope.tappedNotification == 2) { // url launch + NVRDataModel.debug("Came via app url launch with mid="+$rootScope.tappedMid); + NVRDataModel.debug("Came via app url launch with eid="+$rootScope.tappedEid); + $rootScope.tappedNotification = 0; + $ionicHistory.nextViewOptions( + { + disableBack: true + }); + + if (parseInt($rootScope.tappedMid) > 0) + { + NVRDataModel.debug("Going to live view "); + $state.go("app.monitors", + {}, + { + reload: true + }); + return; + + } + + else if (parseInt($rootScope.tappedEid) > 0) { + NVRDataModel.debug("Going to events with EID=" + $rootScope.tappedEid); + $state.go("app.events", + { + //"id": $rootScope.tappedEid, + "id": 0, + "playEvent": true + }, + { + reload: true + }); + return; + } + // go with monitor first, then event - just because I feel like ;) + + + } + else if ($rootScope.tappedNotification == 1) // push + { + + + NVRDataModel.log("Came via push tap. onTapScreen=" + ld.onTapScreen); + //console.log ("***** NOTIFICATION TAPPED "); + $rootScope.tappedNotification = 0; + $ionicHistory.nextViewOptions( + { + disableBack: true + }); + + if (ld.onTapScreen == $translate.instant('kTapMontage')) + { + NVRDataModel.debug("Going to montage"); + $state.go("app.montage", + {}, + { + reload: true + }); + + return; + } + else if (ld.onTapScreen == $translate.instant('kTapEvents')) + { + NVRDataModel.debug("Going to events"); + $state.go("app.events", + { + "id": 0, + "playEvent": false + }, + { + reload: true + }); + return; + } + else // we go to live + { + NVRDataModel.debug("Going to live view "); + $state.go("app.monitors", + {}, + { + reload: true + }); + return; + } + } + + } + + + //------------------------------------------------------------------ // doLogin() emits this when our auth credentials work //------------------------------------------------------------------ |
