summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-04-21 07:20:25 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-04-21 07:20:25 -0400
commitd16e550500093b9f885c8c55d3ef8f6d392ce6ab (patch)
treeb4cf274e14d62b80e38eb21c1a2a83a09ad00729
parentf60a57d706f71950fb3a15438eba13053c59eaa7 (diff)
#606 allow navigation for moments in event modal
-rw-r--r--www/js/EventModalCtrl.js52
-rw-r--r--www/js/MomentCtrl.js3
-rw-r--r--www/templates/events-modal.html4
-rw-r--r--www/templates/monitors-modal.html4
4 files changed, 43 insertions, 20 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js
index bdcf3253..92336880 100644
--- a/www/js/EventModalCtrl.js
+++ b/www/js/EventModalCtrl.js
@@ -24,6 +24,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
var handle;
var showLive = true;
var maxAlarmFid = 0;
+ var eventId = 0;
+ var isSnapShotEnabled = false;
@@ -972,11 +974,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
});
- $scope.modalImageLoaded = function() {
- console.log ("MODAL IMAGE LOADED");
- if (m.snapshot != 'enabled') currentStreamState = streamState.ACTIVE;
- };
-
+
$scope.$on('modal.shown', function(e, m)
{
@@ -988,8 +986,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
showLive = true;
if (m.snapshot == 'enabled') {
+ isSnapShotEnabled = true;
currentStreamState = streamState.SNAPSHOT;
maxAlarmFid = m.snapshotId;
+ eventId = m.eventId;
}
@@ -1141,6 +1141,12 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
});
}
+ $scope.modalImageLoaded = function() {
+ console.log ("MODAL IMAGE LOADED");
+ // if (m.snapshot != 'enabled') currentStreamState = streamState.ACTIVE;
+ };
+
+
$scope.videoTime = function(s, c)
{
var a, o;
@@ -1382,10 +1388,6 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
$scope.onSwipeEvent = function(eid, dirn)
{
- if ($scope.liveFeedMid) return;
- //console.log("HERE");
- var ld = NVRDataModel.getLogin();
- if (!ld.canSwipeMonitors) return;
if ($ionicScrollDelegate.$getByHandle("imgscroll").getScrollPosition().zoom != 1)
{
@@ -1393,17 +1395,35 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
return;
}
- if (ld.useNphZmsForEvents)
- {
- NVRDataModel.log("using zms to move ");
- jumpToEventZms($scope.connKey, dirn);
- // sendCommand ( dirn==1?'13':'12',$scope.connKey);
+ if ($scope.liveFeedMid) return;
+ var ld = NVRDataModel.getLogin();
+ if (!ld.canSwipeMonitors) return;
+ if ($state.current.name=="app.moment") {
+ // console.log ("Searching for eid:"+eventId);
+ var i;
+ for (i=0; i < $scope.moments.length;i++) {
+ if ($scope.moments[i].Event.Id == eventId) break;
+ }
+ // console.log ("Event found at index:"+i);
+ if (dirn == -1 && i > 0) i--;
+ if (dirn == 1 && i < $scope.moments.length -1) i++;
+ NVRDataModel.debug ("Next is index:"+i+" maxScoreId:"+$scope.moments[i].Event.MaxScoreFrameId);
+ maxAlarmFid = $scope.moments[i].Event.MaxScoreFrameId;
+ eventId = $scope.moments[i].Event.Id;
}
- else
+
+ if (currentStreamState == streamState.ACTIVE) {
+ NVRDataModel.log("using zms to move ");
+ jumpToEventZms($scope.connKey, dirn);
+ }
+
+
+
+ /* else
{
jumpToEvent(eid, dirn);
- }
+ }*/
//console.log("JUMPING");
diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js
index 635e79b5..4abe5c9f 100644
--- a/www/js/MomentCtrl.js
+++ b/www/js/MomentCtrl.js
@@ -591,6 +591,9 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
showLive:sl,
snapshot: 'enabled',
snapshotId:event.Event.MaxScoreFrameId,
+ eventId:event.Event.Id
+ //eventId:event.Event.Id
+
})
.then(function (modal) {
diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html
index f070fe9b..4cde877e 100644
--- a/www/templates/events-modal.html
+++ b/www/templates/events-modal.html
@@ -19,7 +19,7 @@
<img ng-if="!liveFeedMid" image-spinner-src="{{constructStream()}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}" on-double-tap="closeModal();"
img-spinner-w="1024" img-spinner-h="768" image-spinner-loader="lines"
- onload="modalImageLoaded()"
+ imageonload="modalImageLoaded()"
/>
@@ -27,7 +27,7 @@
<img image-spinner-src="{{loginData.streamingurl}}/nph-zms?mode=jpeg&monitor={{liveFeedMid}}&connkey={{connKey}}{{$root.authSession}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}" on-double-tap="closeModal();"
img-spinner-w="1024" img-spinner-h="768"
image-spinner-loader="lines"
- onload="modalImageLoaded()"
+ imageonload="modalImageLoaded()"
/>
<div class="events-range-modal-text"><span class="events-range-modal-warning-text">{{eventWarning}}</span> </div>
</div>
diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html
index 86407756..17a897db 100644
--- a/www/templates/monitors-modal.html
+++ b/www/templates/monitors-modal.html
@@ -158,11 +158,11 @@
</a>
</li>
- <li ng-if="isToggleListMenu">
+ <!-- <li ng-if="isToggleListMenu">
<a href="" ng-click="toggleZone()">
<i class="icon ion-qr-scanner"></i>
</a>
- </li>
+ </li>-->
<!-- zone editing is TBD -->
<li ng-if="showZones && 0 && isToggleListMenu">