diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2020-09-05 09:31:45 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2020-09-05 09:31:45 -0400 |
| commit | e71e9c7ce960ec95edd4af5783a62efb14fc1607 (patch) | |
| tree | 78e30a91eac9cbef0394a12d71d05ae2fc7d0e26 /www/js | |
| parent | 058fcb07bf1529339fa5c18cab233c48cdce6a1b (diff) | |
#963 allow size selection of thumbs
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DevOptionsCtrl.js | 29 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 22 | ||||
| -rw-r--r-- | www/js/NVR.js | 10 |
3 files changed, 58 insertions, 3 deletions
diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js index d735f967..2af824b5 100644 --- a/www/js/DevOptionsCtrl.js +++ b/www/js/DevOptionsCtrl.js @@ -143,6 +143,8 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' NVR.debug("SaveDevOptions: Saving to disk"); NVR.setLogin($scope.loginData); + + //console.log ($scope.loginData); NVR.getMonitors(1); } @@ -210,6 +212,33 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' }); }; + $scope.selectEventViewThumbsSize = function() { + + var buttons = [ + + { text: $translate.instant('kEventViewThumbsSmall'), value:'small' }, + { text: $translate.instant('kEventViewThumbsLarge'), value:'large' }, + + ]; + + $ionicActionSheet.show({ + titleText: $translate.instant('kSelect'), + buttons: buttons, + + cancelText: $translate.instant('kButtonCancel'), + cancel: function() { + NVR.debug ('obfuscation actionsheet cancelled'); + }, + buttonClicked: function(index) { + + $scope.loginData.eventViewThumbsSize = buttons[index].value; + NVR.debug ('changed event view thumbs size to:'+$scope.loginData.eventViewThumbsSize ); + return true; + }, + + }); + }; + $scope.saveDevOptions = function () { saveDevOptions(); diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index d7dd4fc1..a83f6b1e 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -195,6 +195,14 @@ angular.module('zmApp.controllers') //console.log ("********* BEFORE ENTER"); // + $scope.thumbClass = 'small'; + var ld = NVR.getLogin(); + if (ld.eventViewThumbsSize == 'large') { + NVR.debug ('Switching to big thumbs style'); + $scope.thumbClass = 'large'; + } else { + NVR.debug ('using small thumbs style'); + } $scope.mid = ''; $scope.$on ("alarm", function() { @@ -2955,8 +2963,18 @@ angular.module('zmApp.controllers') function computeThumbnailSize(mw, mh, mo) { - tw = Math.round(0.9 * $rootScope.devWidth); - th = Math.round(0.7 * $rootScope.devHeight); + var ld = NVR.getLogin(); + + if (ld.eventViewThumbsSize == 'large') { + tw = Math.round(0.9 * $rootScope.devWidth); + th = Math.round(0.7 * $rootScope.devHeight); + } else { + tw = Math.round(0.4 * $rootScope.devWidth); + th = Math.round(0.3 * $rootScope.devHeight); + } + + + var ratio = mw / mh; var result = { diff --git a/www/js/NVR.js b/www/js/NVR.js index 5bdc23b9..a3cf0189 100644 --- a/www/js/NVR.js +++ b/www/js/NVR.js @@ -227,7 +227,9 @@ angular.module('zmApp.controllers') 'httpCordovaNoEncode': false, 'currentZMGroupNames': [], 'unsupported': {}, - 'monitorSpecific': {} + 'monitorSpecific': {}, + 'eventViewThumbs': true, + 'eventViewThumbsSize': 'small', }; @@ -1567,6 +1569,12 @@ angular.module('zmApp.controllers') } + if (typeof loginData.eventViewThumbsSize == 'undefined') { + + loginData.eventViewThumbsSize = 'small'; + + } + if (typeof loginData.enableSlowLoading == 'undefined') { loginData.enableSlowLoading = false; |
