summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/js/MontageCtrl.js40
-rw-r--r--www/lang/locale-en.json1
2 files changed, 40 insertions, 1 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index e97dfe9f..027cd052 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -1366,13 +1366,51 @@ angular.module('zmApp.controllers')
// save current configuration into a profile
$scope.saveMontageProfile = function()
{
+
+ var posArray;
+
+ try
+ {
+ posArray = NVRDataModel.getLogin().packeryPositionsArray;
+ //console.log ("PA="+JSON.stringify(posArray));
+
+ }
+ catch (e)
+ {
+ NVRDataModel.debug("error parsing packery array positions");
+ posArray = {};
+ }
$scope.data = {
montageName: ""
};
+
+ $scope.listdata = [];
+ for (var key in posArray)
+ {
+ if (posArray.hasOwnProperty(key))
+ {
+ $scope.listdata.push(key);
+ }
+ }
+ if ($scope.listdata.indexOf($translate.instant('kMontageDefaultProfile')) == -1)
+ $scope.listdata.push($translate.instant('kMontageDefaultProfile'));
+
+
+ var templ = "<input autocapitalize='none' autocomplete='off' autocorrect='off' type='text' ng-model='data.montageName'>";
+
+ if ($scope.listdata.length)
+ templ += '<br/><div class="item item-divider">'+$translate.instant('kMontageSavedProfiles')+'</div>'+
+ '<ion-list> ' +
+ ' <ion-radio-fix ng-repeat="item in listdata" ng-value="item" ng-model="data.montageName"> ' +
+ ' {{item}} ' +
+ ' </ion-item> ' +
+ '</ion-list> ';
+
+
$rootScope.zmPopup = SecuredPopups.show('confirm',
{
title: $translate.instant('kMontageSave'),
- template: "<input autocapitalize='none' autocomplete='off' autocorrect='off' type='text' ng-model='data.montageName'>",
+ template: templ,
subTitle: $translate.instant('kMontageSaveSubtitle'),
scope: $scope,
okText: $translate.instant('kButtonOk'),
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index a6a53274..4fabbe80 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -221,6 +221,7 @@
"kMontageNoSavedProfiles" :"No saved montage profiles",
"kMontageSave" :"Save Montage Profile",
"kMontageSaveDefaultWarning" :"This profile does not allow monitors to be hidden. Any hidden monitors are now unhidden",
+ "kMontageSavedProfiles" :"currently saved profiles",
"kMontageSaveSubtitle" :"please enter a profile name to save current settings",
"kMonth" :"Month",
"kMore" :"more",