diff options
| -rwxr-xr-x | www/js/DataModel.js | 38 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 3 | ||||
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 37 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 2 | ||||
| -rw-r--r-- | www/templates/events-modal.html | 3 |
5 files changed, 70 insertions, 13 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index e062945d..5263d204 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1360,6 +1360,44 @@ angular.module('zmApp.controllers') }, + updateHrsSinceChecked:function (key) { + var tnow = moment(); + debug ("Updating "+key+" to "+JSON.stringify(tnow)); + localforage.setItem(key, JSON.stringify(tnow)); + }, + + hrsSinceChecked: function(key) { + var tnow = moment(); + var d = $q.defer(); + + localforage.getItem(key) + .then (function (val) { + if (val == null) { + // doesn't exist + localforage.setItem(key, JSON.stringify(tnow)); + debug ( key + " doesn't exist, storing it as:"+tnow); + d.resolve(365*12*24); + return (d.promise); + } + else { + val = JSON.parse(val); + var duration = moment.duration(tnow.diff(val)).asHours().toFixed(1); + debug ("It has been "+duration+" hours since "+key+" was checked" ); + d.resolve(duration); + return (d.promise); + } + return (d.promise); + + }, + function (err) { + debug ("Hmm? hrsSinceCheck failed"); + d.resolve (365*12*24); + return d.promise;} + ); + return d.promise; + + }, + versionCompare: function (l, r) { return versionCompare(l, r); }, diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 5f37fa69..7e6029a2 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -966,7 +966,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.$on('modal.shown', function(e, m) { - console.log ("AUTH="+$rootScope.authSession); + $ionicLoading.hide(); + // console.log ("AUTH="+$rootScope.authSession); if (m.id != 'footage') return; diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index f7ade984..bdc3fffe 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -236,11 +236,19 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic if (NVRDataModel.versionCompare(data, zm.recommendedAppVersion) == -1 && data != "0.0.0") { - $state.go('app.importantmessage', - { - "ver": data + NVRDataModel.hrsSinceChecked("zmVersion") + .then (function (val) { + if (val >=24) { + NVRDataModel.updateHrsSinceChecked("zmVersion"); + $state.go('app.importantmessage', + { + "ver": data + }); + return; + } + }); - return; + } /*if (data == "0.0.0") @@ -449,16 +457,23 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic if (NVRDataModel.versionCompare(data, zm.recommendedAppVersion) == -1 && data != "0.0.0") { + + NVRDataModel.hrsSinceChecked("zmVersion") + .then (function (val) { + if (val >=24) { + NVRDataModel.updateHrsSinceChecked("zmVersion"); + $state.go('app.importantmessage', + { + "ver": data + }); + return; - // console.log (">>>>>>>>>>>>> HERE AND VERSION SAYS " +NVRDataModel.versionCompare(data, zm.recommendedAppVersion)); - //console.log ("GOING TO IMPORTANT"); - $state.go('app.importantmessage', - { - "ver": data + } + }); - return; + } - + /*if (data == "0.0.0") { diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 3830dcf4..0de81d90 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -166,7 +166,7 @@ "kImpMsg1" :"Important Message", "kImpMsg2" :"I'd appreciate if you upgraded ZoneMinder", "kImpMsg3" :"You are running", - "kImpMsg4" :"has some important fixes that enhance the API amongst other things. This is required to avail of the new alarm APIs and other new features.", + "kImpMsg4" :"has some important fixes that enhance functionality and fix bugs that this version of zmNinja relies on. The app will still work, but some functions may be unpredictable.", "kImpMsg5" :"Reported Version", "kImpMsg6" :"Recommended Version", "kImpMsg7" :"Ok, got it", diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index b028a8c1..46da0956 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -15,6 +15,9 @@ <div ng-if="isSnapShot()" class="event-modal-play"> <button class="button button-assertive icon ion-play" ng-click="convertSnapShotToStream()"> {{'kPlay'|translate}}</button> </div> + <div ng-if="isSnapShot()"> + <div class="events-range-modal-text">{{mName}} <i class="ion-arrow-right-b"></i> {{videoDynamicTime}} ({{humanizeTime}}) [{{d_eventId}}] <span class="events-range-modal-warning-text">{{eventWarning}}</span> </div> + </div> <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" |
