diff options
| -rw-r--r-- | www/js/DataModel.js | 8 | ||||
| -rw-r--r-- | www/js/app.js | 16 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 1 | ||||
| -rw-r--r-- | www/templates/devoptions.html | 7 | ||||
| -rw-r--r-- | www/templates/events.html | 3 |
5 files changed, 34 insertions, 1 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 6c9b806c..382f1f36 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -144,6 +144,7 @@ angular.module('zmApp.controllers') 'fastLogin': true, 'followTimeLine': false, 'timelineScale': -1, + 'hideArchived': false, }; @@ -964,6 +965,13 @@ angular.module('zmApp.controllers') } + if (typeof loginData.hideArchived == 'undefined') + { + + loginData.hideArchived = false; + + } + log("DataModel init recovered this loginData as " + JSON.stringify(loginData)); } else diff --git a/www/js/app.js b/www/js/app.js index 359343ff..4827af11 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -102,6 +102,22 @@ angular.module('zmApp', [ }) +.filter ('eventListFilter', function(NVRDataModel) +{ + return function (input) { + var ld = NVRDataModel.getLogin(); + var out = []; + angular.forEach (input, function (item) + { + if (item.Event.Archived == '0' || !ld.hideArchived) { + out.push(item); + } + }); + return out; + }; + +}) + // filter for montage iteration .filter('onlyEnabled', function() { diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index f8eec80f..2ba6871c 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -141,6 +141,7 @@ "kH264VideoSupport" :"H264 Video support", "kHelp" :"Help", "kHideMonsWithoutEvents" :"Hide monitors without events", + "kHideArchived" :"Hide Archived Events", "kHideTip" :"hide tip", "kHighBWDisplay" :"high bandwidth", "kId" :"Id", diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html index 2c373418..00a90880 100644 --- a/www/templates/devoptions.html +++ b/www/templates/devoptions.html @@ -109,6 +109,13 @@ {{'kWarningLargeTimeline' | translate}} </label> </div> + + <label> + <ion-toggle ng-model="loginData.hideArchived" ng-checked="loginData.hideArchived" toggle-class="toggle-calm"><span class="item-text-wrap">{{'kHideArchived' | translate}} + </span> + </ion-toggle> + </label> + <label> <ion-toggle ng-model="loginData.disableAlarmCheckMontage" ng-checked="loginData.disableAlarmCheckMontage" toggle-class="toggle-calm"><span class="item-text-wrap">{{'kDisableAlarmMontage' | translate}} <p>{{'kDisableAlarmMontageSub' | translate}}</p></span> diff --git a/www/templates/events.html b/www/templates/events.html index b0adba94..d4e07324 100644 --- a/www/templates/events.html +++ b/www/templates/events.html @@ -25,7 +25,8 @@ <!-- lets make sure the events list is not empty as collection repeat needs height --> <div ng-if="!eventsBeingLoaded"> <ion-list show-delete="eventList.showDelete"> - <ion-item collection-repeat="event in events| filter:search.text" item-height="event.Event.height" id="item-{{$index}}" on-swipe-left="checkSwipe($index);"> + <ion-item collection-repeat="event in events| filter:search.text | eventListFilter + " item-height="event.Event.height" id="item-{{$index}}" on-swipe-left="checkSwipe($index);"> <span style="float:left;margin-top:-18px;background-color:#96281B;color:#fff;font-size:11px;opacity:0.7;border-radius: 0px 0px 5px 5px;"> <i class="ion-calendar"></i> {{prettifyTime(event.Event.StartTime)}} {{tzAbbr}} </span> <span style="float:left;margin-top:-18px;background-color:#fff;color:#888;font-size:11px;opacity:1;"> <i class="ion-arrow-right-b"></i> {{event.Event.humanizeTime}} <span ng-if="!event.Event.EndTime">(<span translate="kRecordingProgress"></span>)</span> </span> |
