summaryrefslogtreecommitdiff
path: root/www/js/MonitorModalCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-08-22 14:35:28 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-08-22 14:35:28 -0400
commit101b42deea3958963bbc569e2449d3886c59835b (patch)
treea2dabd328a12626967571483323a04b076a9eea0 /www/js/MonitorModalCtrl.js
parent6b84852df705b8c6804759d39cebf48f2e487d3a (diff)
#306 - separate controls from presets and switch button between 'presets' and 'more'
Former-commit-id: bb9481437f71fe99ccd3776199330833d46ad821
Diffstat (limited to 'www/js/MonitorModalCtrl.js')
-rw-r--r--www/js/MonitorModalCtrl.js62
1 files changed, 40 insertions, 22 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);