summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorARC <arjunrc@gmail.com>2015-05-11 16:22:57 -0400
committerARC <arjunrc@gmail.com>2015-05-11 16:22:57 -0400
commitb2367f35e32fad3f2383b9e124df87211f669b59 (patch)
treeb5413f011afb697c80db98b011d19149272da432 /www/js
parentff36c7d3135246ce68f782cabf6d92a3f762d2fd (diff)
nits - not much to describe
Diffstat (limited to 'www/js')
-rw-r--r--www/js/MonitorCtrl.js76
-rw-r--r--www/js/app.js32
2 files changed, 77 insertions, 31 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js
index aec49697..8b60c1a4 100644
--- a/www/js/MonitorCtrl.js
+++ b/www/js/MonitorCtrl.js
@@ -5,11 +5,13 @@
// controller for Monitor View
// refer to comments in EventCtrl for the modal stuff. They are almost the same
-angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state',function ($scope, ZMDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state) {
+angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopup', '$scope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', function ($ionicPopup,$scope, ZMDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope) {
$scope.monitors = [];
+
+
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
@@ -24,6 +26,16 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', '
});
};
+ $scope.notSupported = function()
+ {
+
+ $ionicPopup.alert({
+ title: 'In a Galaxy Far Far Away...',
+ template: 'This feature will be supported sometime in the future.'
+ });
+ };
+
+
$scope.isSimulated = function () {
return ZMDataModel.isSimulated();
};
@@ -46,6 +58,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', '
$scope.$on('$ionicView.enter', function () {
console.log("**VIEW ** Monitor Ctrl Entered");
+
});
$scope.$on('$ionicView.leave', function () {
@@ -59,37 +72,38 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', '
$scope.openModal = function (mid) {
console.log("Open Monitor Modal");
- $scope.monitorId = mid;
- $scope.LoginData = ZMDataModel.getLogin();
- $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
-
- // This is a modal to show the monitor footage
- $ionicModal.fromTemplateUrl('templates/monitors-modal.html', {
- scope: $scope,
- animation: 'slide-in-up'
- })
- .then(function (modal) {
- $scope.modal = modal;
-
- $ionicLoading.show({
- template: "please wait...",
- noBackdrop: true,
- duration: 15000
- });
- $scope.modal.show();
+ $scope.monitorId = mid;
+ $scope.LoginData = ZMDataModel.getLogin();
+ $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
+
+ // This is a modal to show the monitor footage
+ $ionicModal.fromTemplateUrl('templates/monitors-modal.html', {
+ scope: $scope,
+ animation: 'slide-in-up'
+ })
+ .then(function (modal) {
+ $scope.modal = modal;
+
+ $ionicLoading.show({
+ template: "please wait...",
+ noBackdrop: true,
+ duration: 15000
});
+ $scope.modal.show();
+ });
};
+
$scope.closeModal = function () {
- console.log("Close & Destroy Monitor Modal");
- $scope.modal.remove();
+ console.log("Close & Destroy Monitor Modal");
+ $scope.modal.remove();
};
//Cleanup the modal when we're done with it!
$scope.$on('$destroy', function () {
- console.log("Destroy Monitor Modal");
- $scope.modal.remove();
- });
+ console.log("Destroy Monitor Modal");
+ $scope.modal.remove();
+});
@@ -98,14 +112,14 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', '
$scope.monitors = message;
$scope.doRefresh = function () {
- console.log("***Pull to Refresh");
- $scope.monitors = [];
+ console.log("***Pull to Refresh");
+ $scope.monitors = [];
- var refresh = ZMDataModel.getMonitors(1);
- refresh.then(function (data) {
- $scope.monitors = data;
- $scope.$broadcast('scroll.refreshComplete');
- });
+ var refresh = ZMDataModel.getMonitors(1);
+ refresh.then(function (data) {
+ $scope.monitors = data;
+ $scope.$broadcast('scroll.refreshComplete');
+ });
};
diff --git a/www/js/app.js b/www/js/app.js
index e1c724b5..2769e73d 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -17,6 +17,7 @@ angular.module('zmApp', [
// via img tags where this directive is added (I am using this in
// events and mionitor view to show a loader while the image is
// downloading from ZM
+
.directive('imageonload', function () {
return {
restrict: 'A',
@@ -46,9 +47,38 @@ angular.module('zmApp', [
//console.log("*** HTTP INTERCEPTOR CALLED ***");
return config;
}
+
+
};
})
+/* For future use - does not work with img src intercepts
+.factory ('httpAuthIntercept', function ($rootScope, $q)
+{
+ return {
+ requestError: function (response) {
+ console.log ("**** REJECT REQUEST: "+JSON.stringify(response));
+ return $q.reject(response);
+ },
+
+ responseError: function (response) {
+ console.log ("**** REJECT RESPONSE: "+JSON.stringify(response));
+ return $q.reject(response);
+ },
+ response: function (response)
+ {
+ console.log("*******RESPONSE with status: "+response.status+"****************");
+ if (response.status == 500)
+ {
+ console.log ("**** RESPONSE: "+JSON.stringify(response));
+ }
+ return (response);
+ }
+ };
+})
+*/
+
+
.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen) {
ZMDataModel.init();
@@ -145,6 +175,8 @@ angular.module('zmApp', [
.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
$httpProvider.interceptors.push('timeoutHttpIntercept');
+ //$httpProvider.interceptors.push('httpAuthIntercept');
+
$stateProvider
.state('login', {