summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/app.js')
-rwxr-xr-xwww/js/app.js102
1 files changed, 102 insertions, 0 deletions
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
//------------------------------------------------------------------