diff options
| author | Pliable Pixels <pliablepixels@users.noreply.github.com> | 2018-10-15 10:42:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 10:42:02 -0400 |
| commit | 7d696e85cbe7112ebc2a1b49ee957e42209a404c (patch) | |
| tree | ff8135ee4b1ffeac839c8f3365d5d82e29760d77 /www/js/EventModalCtrl.js | |
| parent | 1cd6c1ba5f1944b411f871bedeb65e93c9530bc4 (diff) | |
| parent | fb73ec7092b1763c4d64148dd8230751e10eec68 (diff) | |
Merge branch 'master' into master
Diffstat (limited to 'www/js/EventModalCtrl.js')
| -rw-r--r-- | www/js/EventModalCtrl.js | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 0e6d6be7..b992017c 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -403,49 +403,49 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro } }) .then(function (resp) { - //NVRDataModel.debug ("processEvent success:"+JSON.stringify(resp)); + //NVRDataModel.debug ("processEvent success:"+JSON.stringify(resp)); - resp = resp.data; - if (resp.result == "Ok") { + resp = resp.data; + if (resp.result == "Ok") { - if (resp.status) $scope.currentProgress.progress = resp.status.progress; - if (resp.status && resp.status.event) $scope.eventId = resp.status.event; - $scope.d_eventId = $scope.eventId; - if (resp.status) $scope.currentRate = resp.status.rate; - - if ($scope.currentProgress.progress > $scope.currentEventDuration) $scope.currentProgress.progress = $scope.currentEventDuration; - $scope.progressText = "At " + $scope.currentProgress.progress + "s of " + $scope.currentEventDuration + "s"; + if (resp.status) $scope.currentProgress.progress = resp.status.progress; + if (resp.status && resp.status.event) $scope.eventId = resp.status.event; + $scope.d_eventId = $scope.eventId; + if (resp.status) $scope.currentRate = resp.status.rate; - $scope.sliderProgress.progress = $scope.currentProgress.progress; + if ($scope.currentProgress.progress > $scope.currentEventDuration) $scope.currentProgress.progress = $scope.currentEventDuration; + $scope.progressText = "At " + $scope.currentProgress.progress + "s of " + $scope.currentEventDuration + "s"; - // lets not do this and use zms to move forward or back - // as this code conflicts with fast rev etc - //if (Math.floor(resp.status.progress) >=$scope.currentEventDuration) + $scope.sliderProgress.progress = $scope.currentProgress.progress; - //$timeout (checkEvent(), zm.eventPlaybackQuery); - //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); + // lets not do this and use zms to move forward or back + // as this code conflicts with fast rev etc + //if (Math.floor(resp.status.progress) >=$scope.currentEventDuration) - } else // resp.result was messed up + //$timeout (checkEvent(), zm.eventPlaybackQuery); + //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); - { - NVRDataModel.debug("Hmm I found an error " + JSON.stringify(resp)); - //window.stop(); - // $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); + } else // resp.result was messed up - // console.log (JSON.stringify(resp)); - /*$timeout(function() { - sendCommand('14', $scope.connKey, '&offset=' + $scope.currentProgress.progress); - }, 500); - NVRDataModel.debug("so I'm regenerating Connkey to " + $scope.connKey);*/ + NVRDataModel.debug("Hmm I found an error " + JSON.stringify(resp)); + //window.stop(); + // $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); + + // console.log (JSON.stringify(resp)); + /*$timeout(function() + { + sendCommand('14', $scope.connKey, '&offset=' + $scope.currentProgress.progress); + }, 500); + NVRDataModel.debug("so I'm regenerating Connkey to " + $scope.connKey);*/ - } - }, - function (resp) { - NVRDataModel.debug("processEvent error:" + JSON.stringify(resp)); - //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); + } + }, + function (resp) { + NVRDataModel.debug("processEvent error:" + JSON.stringify(resp)); + //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); - }); + }); } @@ -1038,12 +1038,12 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro //desktop $ionicLoading.hide(); - - $rootScope.zmPopup = SecuredPopups.show('alert', { + + $rootScope.zmPopup = SecuredPopups.show('alert', { title: $translate.instant('kNote'), - template: $translate.instant('kDownloadVideoImage')+"<br/><br/><center><a href='" + url + "' class='button button-assertive icon ion-android-download' download>"+" "+$translate.instant('kDownload')+"</a></center>", + template: $translate.instant('kDownloadVideoImage') + "<br/><br/><center><a href='" + url + "' class='button button-assertive icon ion-android-download' download>" + " " + $translate.instant('kDownload') + "</a></center>", okText: $translate.instant('kDismiss'), - okType:'button-stable' + okType: 'button-stable' }); @@ -1551,42 +1551,42 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro return $http.delete(apiDelete) .then(function (data) { - data = data.data; - $ionicLoading.hide(); - // NVRDataModel.debug("delete output: " + JSON.stringify(data)); + data = data.data; + $ionicLoading.hide(); + // NVRDataModel.debug("delete output: " + JSON.stringify(data)); - if (data.message == 'Error') { - $ionicLoading.show({ - template: "{{'kError' | translate}}...", - noBackdrop: true, - duration: 1500 - }); + if (data.message == 'Error') { + $ionicLoading.show({ + template: "{{'kError' | translate}}...", + noBackdrop: true, + duration: 1500 + }); - } else { + } else { - $ionicLoading.hide(); - $ionicLoading.show({ - template: "{{'kSuccess' | translate}}...", - noBackdrop: true, - duration: 1000 - }); + $ionicLoading.hide(); + $ionicLoading.show({ + template: "{{'kSuccess' | translate}}...", + noBackdrop: true, + duration: 1000 + }); - } + } - // NVRDataModel.displayBanner('info', [$translate.instant('kDeleteEventSuccess')], 2000, 2000); + // NVRDataModel.displayBanner('info', [$translate.instant('kDeleteEventSuccess')], 2000, 2000); - //doRefresh(); + //doRefresh(); - }, - function (data) { - $ionicLoading.hide(); - NVRDataModel.debug("delete error: " + JSON.stringify(data)); - NVRDataModel.displayBanner('error', [$translate.instant('kDeleteEventError1'), $translate.instant('kDeleteEventError2')]); - }); + }, + function (data) { + $ionicLoading.hide(); + NVRDataModel.debug("delete error: " + JSON.stringify(data)); + NVRDataModel.displayBanner('error', [$translate.instant('kDeleteEventError1'), $translate.instant('kDeleteEventError2')]); + }); } //-------------------------------------------------------- //Navigate to next/prev event in full screen mode |
