diff options
| -rw-r--r-- | ionic.project | 2 | ||||
| -rw-r--r-- | package.json | 3 | ||||
| -rw-r--r-- | plugins/android.json | 4 | ||||
| -rw-r--r-- | www/css/style.css | 3 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/LogCtrl.js | 69 | ||||
| -rw-r--r-- | www/js/LoginCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/app.js | 28 | ||||
| -rw-r--r-- | www/templates/events-modal.html | 2 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 2 | ||||
| -rw-r--r-- | www/templates/montage.html | 2 |
11 files changed, 98 insertions, 21 deletions
diff --git a/ionic.project b/ionic.project index f63d5bbc..9fff8cd8 100644 --- a/ionic.project +++ b/ionic.project @@ -1,6 +1,6 @@ { "name": "zmNinja", - "app_id": "", + "app_id": "8f73ad5f", "browsers": [ { "platform": "android", diff --git a/package.json b/package.json index 8c71f8ef..1112ad06 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ }, "cordovaPlugins": [ "org.apache.cordova.splashscreen", - "org.apache.cordova.inappbrowser" + "org.apache.cordova.inappbrowser", + "phonegap-plugin-push" ], "cordovaPlatforms": [ "ios", diff --git a/plugins/android.json b/plugins/android.json index 9a0659f9..869d6005 100644 --- a/plugins/android.json +++ b/plugins/android.json @@ -102,7 +102,9 @@ "xml": "<uses-permission android:name=\"android.permission.INTERNET\" />", "count": 1 } - ] + ], + "/manifest": [], + "/manifest/application": [] } } } 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> |
