summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/css/style.css3
-rw-r--r--www/js/EventCtrl.js2
-rw-r--r--www/js/LogCtrl.js69
-rw-r--r--www/js/LoginCtrl.js2
-rw-r--r--www/js/app.js28
-rw-r--r--www/templates/events-modal.html2
-rw-r--r--www/templates/monitors-modal.html2
-rw-r--r--www/templates/montage.html2
8 files changed, 92 insertions, 18 deletions
diff --git a/www/css/style.css b/www/css/style.css
index 0c8d0ec0..47ac0738 100644
--- a/www/css/style.css
+++ b/www/css/style.css
@@ -188,8 +188,9 @@ http://www.cssportal.com/tryit/index.php?file=blog/css-notification-badge */
position:absolute;
bottom:20px;
left: 100px;
+
z-index:10;
- opacity:1;
+ opacity:0.7;
}
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index c68f2947..6ef6c265 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -560,7 +560,7 @@ angular.module('zmApp.controllers')
callback: function (value, released) {
//console.log("CALLBACK"+value+released);
$ionicScrollDelegate.freezeScroll(!released);
- ZMDataModel.zmDebug("EventCtrl: freezeScroll called with " + !released);
+ //ZMDataModel.zmDebug("EventCtrl: freezeScroll called with " + !released);
},
diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js
index 06e3a3d7..36c1e42f 100644
--- a/www/js/LogCtrl.js
+++ b/www/js/LogCtrl.js
@@ -2,7 +2,7 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console */
-angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$rootScope','zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$fileLogger', '$cordovaEmailComposer', '$ionicPopup', '$timeout', '$ionicHistory', '$state', function ($scope, $rootScope,zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $fileLogger, $cordovaEmailComposer, $ionicPopup, $timeout, $ionicHistory, $state) {
+angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$rootScope','zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$fileLogger', '$cordovaEmailComposer', '$ionicPopup', '$timeout', '$ionicHistory', '$state', '$interval', function ($scope, $rootScope,zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $fileLogger, $cordovaEmailComposer, $ionicPopup, $timeout, $ionicHistory, $state, $interval) {
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
@@ -10,8 +10,31 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo
//---------------------------------------------------------------
// Controller main
//---------------------------------------------------------------
- $scope.zmAppVersion = ZMDataModel.getAppVersion();
-
+
+ var intervalLogUpdateHandle;
+
+ document.addEventListener("pause", onPause, false);
+ document.addEventListener("resume", onResume, false);
+
+ function onPause()
+ {
+ ZMDataModel.zmDebug("LogCtrl: pause called, killing log timer");
+ $interval.cancel(intervalLogUpdateHandle);
+ }
+
+
+ function onResume()
+ {
+ ZMDataModel.zmDebug("LogCtrl: resume called, starting log timer");
+ intervalLogUpdateHandle = $interval(function ()
+ {
+ loadLogs();
+
+ }.bind(this), 3000);
+
+ loadLogs();
+ }
+
$scope.deleteLogs = function () {
@@ -109,6 +132,22 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo
}
}
+
+ function loadLogs()
+ {
+ //console.log ("GETTING LOGS");
+ $fileLogger.getLogfile().then(function (l) {
+
+
+ $scope.zmLog.logString = l.split('\n').reverse().join('\n');
+ //$scope.zmLog.logString = Math.random() + $scope.zmLog.logString;
+ // console.log ("UPDATING LOGS");
+ //console.log ("LOGS" + logstring);
+ },
+ function (error) {
+ $scope.zmLog.logString = "Error getting log: " + JSON.stringify(error);
+ });
+ }
//-------------------------------------------------------------------------
// Lets make sure we set screen dim properly as we enter
@@ -124,17 +163,25 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo
$scope.zmLog = {
logString: ""
};
- $fileLogger.getLogfile().then(function (l) {
+
+ $scope.zmAppVersion = ZMDataModel.getAppVersion();
- $scope.zmLog.logString = l.split('\n').reverse().join('\n');
-
- //console.log ("LOGS" + logstring);
- },
- function (error) {
- $scope.zmLog.logString = "Error getting log: " + JSON.stringify(error);
- });
+ intervalLogUpdateHandle = $interval(function ()
+ {
+ loadLogs();
+
+ }.bind(this), 3000);
+
+ loadLogs();
+
});
+
+ $scope.$on('$ionicView.leave', function ()
+ {
+ console.log ("Deleting Log interval...");
+ $interval.cancel(intervalLogUpdateHandle);
+ });
}]);
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 714385c0..36ae4d47 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -245,7 +245,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
$http.get(apiurl)
.success(function (data) {
- EventServer.start();
+ EventServer.refresh();
$ionicPopup.alert({
title: 'Login validated',
diff --git a/www/js/app.js b/www/js/app.js
index 47f6fa87..25cca497 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -14,6 +14,7 @@ angular.module('zmApp', [
'fileLogger',
'angular-carousel',
'angularAwesomeSlider',
+
@@ -535,6 +536,7 @@ angular.module('zmApp', [
$ionicPlatform.ready(function () {
+
console.log("**** DEVICE READY ***");
// generates and error in desktops but works fine
ZMDataModel.zmLog("Device is ready");
@@ -549,7 +551,31 @@ angular.module('zmApp', [
} else {
console.log("Log file size is " + resp.size + " bytes");
}
-
+
+ ZMDataModel.zmLog ("Setting up zmNinja for push notifications");
+
+ /* $ionicPush.init({
+ "debug": true,
+ "onNotification": function(notification) {
+ var payload = notification.payload;
+ console.log("************PUSH PAYLOAD************" + notification, payload);
+ },
+ "onRegister": function(data) {
+ console.log("********** PUSH REGISTER *************" + data.token);
+ },
+ "pluginConfig": {
+ "ios": {
+ "badge": true,
+ "sound": true
+ },
+ "android": {
+ "iconColor": "#343434"
+ }
+ }
+
+ });
+
+ $ionicPush.register();*/
});
diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html
index 0c7133f1..0266fab5 100644
--- a/www/templates/events-modal.html
+++ b/www/templates/events-modal.html
@@ -68,7 +68,7 @@
</div>
<span class="event-modal-alarm-badge">
- <a data-badge="{{$root.alarmCount}}" class="animated infinite tada button icon button-clear ion-ios-bell notification-badge"
+ <a data-badge="{{$root.alarmCount}}" class="animated infinite tada button icon ion-ios-bell notification-badge button-assertive"
ng-click="handleAlarms();" ng-if="$root.isAlarm" ></a>
</span>
diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html
index 8ab0a0f6..50d9c2cc 100644
--- a/www/templates/monitors-modal.html
+++ b/www/templates/monitors-modal.html
@@ -62,7 +62,7 @@
</span>
<span class="modal-alarm-badge">
- <a data-badge="{{$root.alarmCount}}" class="animated infinite tada button icon button-clear ion-ios-bell notification-badge"
+ <a data-badge="{{$root.alarmCount}}" class="animated infinite tada button icon ion-ios-bell notification-badge button-assertive"
ng-click="handleAlarms();" ng-if="$root.isAlarm"></a>
</span>
diff --git a/www/templates/montage.html b/www/templates/montage.html
index c416c4f3..d2d58f04 100644
--- a/www/templates/montage.html
+++ b/www/templates/montage.html
@@ -99,7 +99,7 @@
</nav>
<span class="modal-alarm-badge">
- <a data-badge="{{$root.alarmCount}}" class="animated infinite tada button icon button-clear ion-ios-bell notification-badge"
+ <a data-badge="{{$root.alarmCount}}" class="animated infinite tada button icon ion-ios-bell notification-badge button-assertive"
ng-click="handleAlarmsWhileMinimized();" ng-if="$root.isAlarm"></a>
</span>