summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-05-09 15:08:01 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-05-09 15:08:01 -0400
commit1d5f5f6ff464053137063d0c7a0f56f8f5cd3543 (patch)
tree013e0a72ff619e40e2f7b5c96f86192626ed2d4a /www
parent2c748df39130050b929d7676daee4e953a808356 (diff)
make Moments play nicer without MaxScoreFrameId
Diffstat (limited to 'www')
-rw-r--r--www/js/EventModalCtrl.js2
-rw-r--r--www/js/MomentCtrl.js60
-rw-r--r--www/templates/moment.html2
3 files changed, 16 insertions, 48 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js
index b550de52..1b33343d 100644
--- a/www/js/EventModalCtrl.js
+++ b/www/js/EventModalCtrl.js
@@ -959,6 +959,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
$scope.snapshotFrameId = m.snapshotId;
isGlobalFid = true;
}
+ else { $scope.snapshotFrameId = 1;}
+
eventId = m.eventId;
$scope.eventId = m.eventId;
diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js
index 6bcf5476..0560e9ed 100644
--- a/www/js/MomentCtrl.js
+++ b/www/js/MomentCtrl.js
@@ -16,6 +16,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
var excludeMonitors = [];
var excludeMonitorsFilter = "";
var momentType = "StartTime";
+ $scope.isMaxScoreFramePresent = false;
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
@@ -259,8 +260,9 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
$scope.constructFrame = function(moment) {
var stream = "";
+ // console.log ($scope.isMaxScoreFramePresent);
stream = moment.Event.baseURL+"/index.php?view=image" +
- "&fid="+moment.Event.MaxScoreFrameId+
+ ($scope.isMaxScoreFramePresent? "&fid="+moment.Event.MaxScoreFrameId: "&eid="+moment.Event.Id+"&fid=1")+
"&width="+moment.Event.thumbWidth*2 +
"&height="+moment.Event.thumbHeight*2;
@@ -605,7 +607,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
id: 'footage',
showLive:sl,
snapshot: 'enabled',
- snapshotId:event.Event.MaxScoreFrameId,
+ snapshotId: $scope.isMaxScoreFramePresent?event.Event.MaxScoreFrameId:undefined,
eventId:event.Event.Id
//eventId:event.Event.Id
@@ -625,42 +627,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
};
- //----------------------------------------------------------------
- // Not used for now - superceded by play Event
- //----------------------------------------------------------------
-
- $scope.showThumbnail = function (b, f) {
-
- if (!f) { // api update needed
-
- $ionicPopup.alert({
- title: $translate.instant('kNote'),
- template: "{{'kApiUpgrade' | translate }}",
- okText: $translate.instant('kButtonOk'),
- cancelText: $translate.instant('kButtonCancel'),
- });
- return;
-
- }
-
- $scope.thumbnailLarge = b + '/index.php?view=image&fid=' + f;
- $ionicModal.fromTemplateUrl('templates/image-modal.html', {
- scope: $scope,
- animation: 'slide-in-up',
- id: 'thumbnail',
- })
- .then(function (modal) {
- $scope.modal = modal;
-
-
- $scope.modal.show();
-
- var ld = NVRDataModel.getLogin();
-
- });
-
- };
-
+
//----------------------------------------------------------------
// Only called by "here" button without cond. So prev type is used
//----------------------------------------------------------------
@@ -772,7 +739,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
])
.then(function () {
- NVRDataModel.debug("$a.all Parallel queries completed");
+ NVRDataModel.debug("$q.all Parallel queries completed");
if (!moments.length) {
$scope.loadingStatus = $translate.instant('kMomentNoneFound');
@@ -799,20 +766,16 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
// check the very first element for presence of maxscoreframe id
// if its not there, we can't show snuff
if (moments.length && !moments[0].Event.MaxScoreFrameId) {
- $ionicPopup.alert({
- title: $translate.instant('kNote'),
- template: "{{'kApiUpgrade' | translate }}",
- okText: $translate.instant('kButtonOk'),
- cancelText: $translate.instant('kButtonCancel'),
- });
+ $scope.isMaxScoreFramePresent =false;
+
} else {
- $scope.moments = moments;
+ $scope.isMaxScoreFramePresent = true;
+ }
+ $scope.moments = moments;
$timeout(function () {
initMasonry();
}, 300);
- }
-
});
@@ -847,6 +810,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$
$scope.showIcons = true;
$scope.areImagesLoading = true;
$scope.expand = false;
+ $scope.isMaxScoreFramePresent = false;
var ld = NVRDataModel.getLogin();
$scope.loadingStatus = $translate.instant('kLoading');
diff --git a/www/templates/moment.html b/www/templates/moment.html
index e58b0e11..f349bba5 100644
--- a/www/templates/moment.html
+++ b/www/templates/moment.html
@@ -26,6 +26,8 @@
<ion-content delegate-handle="moment-delegate" overflow-scroll="false" mouse-wheel-scroll style="background-color:#444444">
<div ng-if="areImagesLoading" class="screen-note">&nbsp;{{ 'kArrangingImages' | translate }}...&nbsp;</div>
+
+ <div ng-if="!areImagesLoading && !isMaxScoreFramePresent" class="screen-note">&nbsp;{{ 'kApiUpgrade' | translate }}&nbsp;</div>
<div ng-if="isSubMenu">
<br/>