diff options
| -rw-r--r-- | package.json | 4 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 36 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 5 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 15 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 9 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 13 | ||||
| -rwxr-xr-x | www/js/app.js | 9 | ||||
| -rw-r--r-- | www/templates/events-modal.html | 6 |
8 files changed, 41 insertions, 56 deletions
diff --git a/package.json b/package.json index cef6619c..bda55376 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zmninjapro", "description": "Home security mobile app for ZoneMinder", - "version":"1.3.040", + "version": "1.3.040", "displayName": "zmNinja", "author": "Pliable Pixels", "license": "custom see LICENSE.md", @@ -180,4 +180,4 @@ ] } } -} +}
\ No newline at end of file diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index b3741489..70883b29 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -2823,23 +2823,27 @@ angular.module('zmApp.controllers') function recomputeThumbSize() { // NVRDataModel.debug("EventCtrl: recompute thumbnails"); - for (var i = 0; i < $scope.events.length; i++) { - var tempMon = NVRDataModel.getMonitorObject($scope.events[i].Event.MonitorId); - if (tempMon != undefined) { - - var mw = parseInt(tempMon.Monitor.Width); - var mh = parseInt(tempMon.Monitor.Height); - var mo = parseInt(tempMon.Monitor.Orientation); - - var th = computeThumbnailSize(mw, mh, mo); - $scope.events[i].Event.thumbWidth = th.w; - $scope.events[i].Event.thumbHeight = th.h; - //console.log ("Setting to "+th.w+"*"+th.h); - + // remember, devHeight/devWidth upate 300ms after rotation + $timeout ( function () { + for (var i = 0; i < $scope.events.length; i++) { + var tempMon = NVRDataModel.getMonitorObject($scope.events[i].Event.MonitorId); + if (tempMon != undefined) { + + var mw = parseInt(tempMon.Monitor.Width); + var mh = parseInt(tempMon.Monitor.Height); + var mo = parseInt(tempMon.Monitor.Orientation); + + var th = computeThumbnailSize(mw, mh, mo); + $scope.events[i].Event.thumbWidth = th.w; + $scope.events[i].Event.thumbHeight = th.h; + //console.log ("Setting to "+th.w+"*"+th.h); + + } + + } - - - } + },500); + } diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 50da86d4..ce39e827 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -1124,9 +1124,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $ionicLoading.hide(); if (m.id != 'footage') - return; + $ionicSideMenuDelegate.canDragContent(false); showLive = true; if (m.snapshot == 'enabled') { @@ -1295,6 +1295,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.$on('modal.removed', function (e, m) { + $ionicSideMenuDelegate.canDragContent(true); if ($rootScope.platformOS == 'desktop') { NVRDataModel.debug("Removing keyboard handler"); window.removeEventListener('keydown', keyboardHandler, true); @@ -2069,7 +2070,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro autoPlay: true, responsive: false, nativeControls: false, - nativeFullScreen: false, + nativeFullScreen: true, playsInline: true, sources: [{ diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index ced3dfe8..41eac0ed 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -27,20 +27,6 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ $scope.csize = ($rootScope.platformOS == 'desktop') ? 10 : 20; - window.addEventListener("resize", imageLoaded, false); - - - //$rootScope.authSession = "undefined"; - - /* $ionicLoading.show({ - template: $translate.instant('kNegotiatingStreamAuth') + '...', - animation: 'fade-in', - showBackdrop: false, - duration: zm.loadingTimeout, - maxWidth: 300, - showDelay: 0 - });*/ - $scope.currentStreamMode = 'single'; NVRDataModel.log("Using stream mode " + $scope.currentStreamMode); @@ -1367,7 +1353,6 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ $scope.$on('modal.removed', function () { - window.removeEventListener("resize", imageLoaded, false); if ($rootScope.platformOS == 'android') { NVRDataModel.debug("Deregistering handlers for multi-window"); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 5ec2ed41..f7944ebb 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1444,11 +1444,7 @@ angular.module('zmApp.controllers') if ($scope.modal) $scope.modal.remove(); }); - function orientationChanged() { - - } - - + // remove a saved montage profile $scope.deleteMontageProfile = function () { var posArray; @@ -2023,8 +2019,7 @@ angular.module('zmApp.controllers') initPackery(); }, zm.packeryTimer); //console.log("**VIEW ** Montage Ctrl AFTER ENTER"); - window.addEventListener("resize", orientationChanged, false); - + if ($rootScope.platformOS != 'android') { document.addEventListener("pause", onPause, false); } else { diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index a83d2ae3..1faf41dd 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -69,12 +69,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc timefrom.toDate(); }; - function orientationChanged() { - // NVRDataModel.debug("Detected orientation change, redoing packery resize"); - /* $timeout(function () { - pckry.onresize(); - });*/ - } + //-------------------------------------- // pause/unpause nph-zms //--------------------------------------- @@ -864,10 +859,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc // make sure this is applied in scope digest to stop network pull // thats why we are doing it beforeLeave pckry.destroy(); - window.removeEventListener("resize", orientationChanged, false); - //NVRDataModel.log("Forcing a window.stop() here"); - //NVRDataModel.stopNetwork("MontageHistory-beforeLeave"); - + }); $scope.$on('$ionicView.unloaded', function () {}); $scope.sliderChanged = function (dirn) { @@ -1294,7 +1286,6 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc $scope.isModalActive = false; $scope.hrsAgo = 4; - window.addEventListener("resize", orientationChanged, false); document.addEventListener("pause", onPause, false); document.addEventListener("resume", onResume, false); diff --git a/www/js/app.js b/www/js/app.js index 6e400e94..f00bca93 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -1727,11 +1727,18 @@ angular.module('zmApp', [ // http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript var checkOrientation = function () { + + // give rotation time to actually rotate, or width/height will be bogus + $timeout ( function() { + var pixelRatio = window.devicePixelRatio || 1; $rootScope.pixelRatio = pixelRatio; $rootScope.devWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width); $rootScope.devHeight = ((window.innerHeight > 0) ? window.innerHeight : screen.height); - //console.log("********NEW Computed Dev Width & Height as" + $rootScope.devWidth + "*" + $rootScope.devHeight); + + // console.log("********NEW Computed Dev Width & Height as" + $rootScope.devWidth + "*" + $rootScope.devHeight); + },300); + }; diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index 99994380..d9f2d5d6 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -63,8 +63,10 @@ <div ng-if="defaultVideo!==undefined && defaultVideo!='' && !isSnapShot() && !isStreamStopped()"> <div ng-if="videoIsReady"> - <!-- <div style="height:{{$root.devHeight}}px; width:{{$root.devWidth}}px;">--> - <div on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" ng-style="{'height':$root.devHeight+'px', 'width':$root.devWidth+'px'}"> + + <!-- <div style="max-width:100%; max-height:100%;" on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" > --> + + <div on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" ng-style="{'height':$root.devHeight+'px', 'width':$root.devWidth+'px'}"> <videogular vg-can-play="onCanPlay()" vg-native-fullscreen="videoObject.config.nativeFullScreen" vg-player-ready="onPlayerReady($API)" vg-update-playback="onPlaybackUpdate($playBack)" |
