summaryrefslogtreecommitdiff
path: root/www/js/StateCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-09-01 11:44:40 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-09-01 11:44:40 -0400
commit2e1a669455190e3d0d857e613cc34cd22f4862c0 (patch)
tree850e2d0abcd5dbbc603b5f054725691ed5abb951 /www/js/StateCtrl.js
parentdc5dd1c8684266c320cccd6e8943b5d419a280e4 (diff)
mostly formatting and removal of console.logs
Former-commit-id: 5cbac40ad5ccb7096fb7b9f58696e923ba282232
Diffstat (limited to 'www/js/StateCtrl.js')
-rw-r--r--www/js/StateCtrl.js56
1 files changed, 30 insertions, 26 deletions
diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js
index c3f2e860..27a7fcc8 100644
--- a/www/js/StateCtrl.js
+++ b/www/js/StateCtrl.js
@@ -5,7 +5,7 @@
// controller for State View
angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup', '$scope', 'zm', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope', '$timeout', '$ionicHistory', '$translate', function (
- $ionicPopup, $scope, zm, ZMDataModel, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout,$ionicHistory, $translate) {
+ $ionicPopup, $scope, zm, ZMDataModel, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout, $ionicHistory, $translate) {
//----------------------------------------------------------------------
// Controller main
@@ -19,10 +19,10 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
$scope.dangerButtonColor = ["button-positive", "button-assertive"];
$scope.customState = "";
$scope.allStateNames = [];
-
+
$rootScope.zmPopup = "";
-
-
+
+
var loginData = ZMDataModel.getLogin();
@@ -43,12 +43,12 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
ZMDataModel.zmDebug("invoking LoadStatus...");
getLoadStatus();
}, 2000);
-
+
$timeout(function () {
ZMDataModel.zmDebug("invoking CurrentState...");
getCurrentState();
}, 4000);
-
+
/*
$timeout(function () {
ZMDataModel.zmDebug("invoking DiskStatus...");
@@ -63,7 +63,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
// state, that effectively overwrites current view power management needs
//------------------------------------------------------------------------
$scope.$on('$ionicView.enter', function () {
- // console.log("**VIEW ** Montage Ctrl Entered");
+ // console.log("**VIEW ** Montage Ctrl Entered");
ZMDataModel.setAwake(false);
});
@@ -99,21 +99,25 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
);
}
-
-
+
+
//----------------------------------------------------------------
// Alarm notification handling
//----------------------------------------------------------------
- $scope.handleAlarms = function()
- {
- $rootScope.isAlarm=!$rootScope.isAlarm;
- if (!$rootScope.isAlarm)
- {
- $rootScope.alarmCount="0";
- $ionicHistory.nextViewOptions({disableBack: true});
- $state.go("events", {"id": 0}, { reload: true });
+ $scope.handleAlarms = function () {
+ $rootScope.isAlarm = !$rootScope.isAlarm;
+ if (!$rootScope.isAlarm) {
+ $rootScope.alarmCount = "0";
+ $ionicHistory.nextViewOptions({
+ disableBack: true
+ });
+ $state.go("events", {
+ "id": 0
+ }, {
+ reload: true
+ });
}
- };
+ };
//---------------------------------------------------------
// Allows the user to select a custom run state
@@ -130,7 +134,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
title: $translate.instant('kSelectRunState'),
- subTitle: $translate.instant('kCurrentState') + $scope.customState ? ($translate.instant('kCurrentState')+": " + $scope.customState) : "",
+ subTitle: $translate.instant('kCurrentState') + $scope.customState ? ($translate.instant('kCurrentState') + ": " + $scope.customState) : "",
buttons: [
{
text: $translate.instant('kButtonCancel'),
@@ -140,7 +144,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
},
{
- text: $translate.instant('kButtonOk'),
+ text: $translate.instant('kButtonOk'),
onTap: function (e) {
return "OK";
@@ -152,7 +156,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
// It seems invoking a popup within a popup handler
// causes issues. Doing this outside due to that reason
$rootScope.zmPopup.then(function (res) {
- // console.log("GOT : " + JSON.stringify(res));
+ // console.log("GOT : " + JSON.stringify(res));
if (res == "OK") {
if ($scope.myopt.selectedState != "")
controlZM($scope.myopt.selectedState);
@@ -178,11 +182,11 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
$scope.zmDisk = "unknown";
ZMDataModel.zmLog("Error retrieving disk space, API returned null for obj.Total.space");
}
-
+
},
function (error) {
$scope.zmDisk = "unknown";
- // console.log("ERROR:" + JSON.stringify(error));
+ // console.log("ERROR:" + JSON.stringify(error));
ZMDataModel.zmLog("Error retrieving DiskStatus: " + JSON.stringify(error), "error");
}
);
@@ -307,7 +311,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
ZMDataModel.zmDebug("StateCtrl/controlZM: operation in progress");
$ionicPopup.alert({
title: $translate.instant('kOperationInProgressTitle'),
- template: $translate.instant('kOperationInProgressBody')+'...'
+ template: $translate.instant('kOperationInProgressBody') + '...'
});
return;
}
@@ -364,8 +368,8 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup'
console.log("***Pull to Refresh");
ZMDataModel.zmDebug("StateCtrl/refresh: calling getRun/Load/Disk/CurrentState");
getRunStatus();
- $timeout (getLoadStatus,2000);
- $timeout (getCurrentState,4000);
+ $timeout(getLoadStatus, 2000);
+ $timeout(getCurrentState, 4000);
//$timeout (getDiskStatus,6000);
$scope.$broadcast('scroll.refreshComplete');