summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/js/MonitorModalCtrl.js62
-rw-r--r--www/lang/locale-en.json1
-rw-r--r--www/templates/monitors-modal.html4
3 files changed, 44 insertions, 23 deletions
diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js
index 4ea57528..0cad2391 100644
--- a/www/js/MonitorModalCtrl.js
+++ b/www/js/MonitorModalCtrl.js
@@ -1031,6 +1031,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
//
function configurePTZ(mid)
{
+ $scope.presetAndControl = $translate.instant('kMore');
$scope.ptzWakeCommand = "";
$scope.ptzSleepCommand = "";
$scope.ptzResetCommand = "";
@@ -1077,6 +1078,8 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
data.control.Control.HasPresets = '1';
data.control.Control.HasHomePreset = '1';*/
// *** Only for testing - comment out - end //
+
+
if (data.control.Control.CanWake == '1')
{
@@ -1142,14 +1145,17 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
// presets
ZMDataModel.zmDebug ("ConfigurePTZ Preset value is " +data.control.Control.HasPresets);
-
+ $scope.ptzPresets = [];
+
if (data.control.Control.HasPresets == '1')
{
+ $scope.presetAndControl = $translate.instant('kPresets');
+
$scope.ptzPresetCount = parseInt(data.control.Control.NumPresets);
ZMDataModel.zmDebug ("ConfigurePTZ Number of presets is " + $scope.ptzPresetCount);
- $scope.ptzPresets = [];
+
for (var p=0; p<$scope.ptzPresetCount; p++)
{
$scope.ptzPresets.push ({name:(p+1).toString(), icon:'', cmd:"presetGoto"+(p+1).toString(), style:'button-royal'});
@@ -1163,29 +1169,41 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
}
- // lets add these to the end
- // strictly speaking, they aren't really presets, but meh for now
-
- if (data.control.Control.CanWake == '1')
- {
-
- $scope.ptzPresets.push({name:'', icon:"ion-eye", cmd:'wake', style:'button-royal button-dark'});
-
- }
-
- if (data.control.Control.CanSleep == '1')
- {
- $scope.ptzPresets.push({name:'', icon:"ion-eye-disabled", cmd:'sleep', style:'button-royal button-dark'});
-
- }
- if (data.control.Control.CanReset == '1')
- {
- $scope.ptzPresets.push({name:'', icon:"ion-ios-loop-strong", cmd:'reset', style:'button-royal button-dark'});
-
- }
}
+ else
+ {
+ $scope.presetAndControl = $translate.instant('kMore');
+ }
+ // lets add these to the end
+ // strictly speaking, they aren't really presets, but meh for now
+
+ // no need to darken these buttons if presets are not there
+ var buttonAccent = "button-dark";
+ if ($scope.ptzPresets.length == 0)
+ {
+ buttonAccent = "";
+ }
+
+ if (data.control.Control.CanWake == '1')
+ {
+
+ $scope.ptzPresets.push({name:'', icon:"ion-eye", cmd:'wake', style:'button-royal '+buttonAccent});
+
+ }
+
+ if (data.control.Control.CanSleep == '1')
+ {
+ $scope.ptzPresets.push({name:'', icon:"ion-eye-disabled", cmd:'sleep', style:'button-royal '+buttonAccent});
+
+ }
+
+ if (data.control.Control.CanReset == '1')
+ {
+ $scope.ptzPresets.push({name:'', icon:"ion-ios-loop-strong", cmd:'reset', style:'button-royal '+buttonAccent});
+
+ }
ZMDataModel.zmLog("ConfigurePTZ Modal: ControlDB reports PTZ command to be " + $scope.ptzMoveCommand);
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index f9ab5a1c..3b33a284 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -176,6 +176,7 @@
"kMontage" :"Montage",
"kMontageImageScale" :"Montage image scale",
"kMonth" :"Month",
+ "kMore" :"more",
"kNeedToKnow" :"I need to know your ZoneMinder login and path details to get started",
"kNegotiatingStreamAuth" :"negotiating stream authentication",
"kNews" :"News",
diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html
index f16dba9b..f82eab45 100644
--- a/www/templates/monitors-modal.html
+++ b/www/templates/monitors-modal.html
@@ -60,7 +60,9 @@
</div>
<br/>
<a class="button button-small icon ion-stop button-assertive" href="" ng-click="controlPTZ(monitorId, ptzStopCommand);"></a>
- <a class="button button-small button-royal" href="" ng-click="togglePresets();">{{'kPresets' | translate}}</a>
+
+
+ <a class="button button-small button-royal" href="" ng-click="togglePresets();">{{presetAndControl}}</a>
</div>
</div>