summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/LogCtrl.js5
-rw-r--r--www/js/LoginCtrl.js1
-rw-r--r--www/js/angular-circular-navigation.js54
-rw-r--r--www/js/app.js22
4 files changed, 78 insertions, 4 deletions
diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js
index d2ff88d8..92b0aaad 100644
--- a/www/js/LogCtrl.js
+++ b/www/js/LogCtrl.js
@@ -2,11 +2,14 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console */
-angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$fileLogger', '$cordovaEmailComposer', '$ionicPopup', function ($scope, $rootScope, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $fileLogger, $cordovaEmailComposer, $ionicPopup) {
+angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$fileLogger', '$cordovaEmailComposer', '$ionicPopup', '$timeout', function ($scope, $rootScope, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $fileLogger, $cordovaEmailComposer, $ionicPopup, $timeout) {
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
+
+
+
//--------------------------------------------------------------------------
// Make sure user knows information masking is best effort
//--------------------------------------------------------------------------
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 4bf04285..7541000e 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -113,6 +113,7 @@ function addhttp(url) {
console.log("Checking API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: " + streamingurl);
+ ZMDataModel.zmLog ("Checking API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: " + streamingurl);
// Let's do a sanity check to see if the URLs are ok
diff --git a/www/js/angular-circular-navigation.js b/www/js/angular-circular-navigation.js
new file mode 100644
index 00000000..f3b9b0a0
--- /dev/null
+++ b/www/js/angular-circular-navigation.js
@@ -0,0 +1,54 @@
+// PP - Modified to show at right angles
+(function () {
+
+ 'use strict';
+
+ /*global define, module, exports, require */
+
+ /* istanbul ignore next */
+ var angular = window.angular ? window.angular : 'undefined' !== typeof require ? require('angular') : undefined;
+
+ var circular = angular.module('angularCircularNavigation', [])
+ .directive('circular', ['$compile', function ($compile) {
+
+ return {
+ restrict: 'EA',
+ scope: {
+ options: '='
+ },
+ template: '<button ng-click="toggleMenu()" class="cn-button {{options.button.size}}" ng-class="options.button.cssClass" style="background: {{options.button.background ? options.button.background : options.background}}; color: {{options.button.color ? options.button.color :options.color}};">{{options.content}}</button>' +
+ '<div class="cn-wrapper {{options.size}} items-{{options.items.length}}" ng-class="{\'opened-nav\': options.isOpen}"><ul>' +
+ '<li ng-repeat="item in options.items">' +
+ '<a ng-hide="item.empty" ng-click="perform(options, item)" ng-class="{\'is-active\': item.isActive}" class="{{item.cssClass}}" style="background: {{item.background ? item.background : options.background}}; color: {{item.color ? item.color : options.color}};">' +
+ '<span>{{item.content}}</span>' +
+ '</a></li></ul></div>',
+ controller: ['$scope', '$element', '$attrs',
+ function ($scope, $element, $attrs) {
+
+ $scope.toggleMenu = function () {
+ $scope.options.isOpen = !$scope.options.isOpen;
+ };
+
+ $scope.perform = function (options, item) {
+ if (typeof item.onclick === 'function') {
+ item.onclick(options, item);
+ }
+
+ if ($scope.options.toggleOnClick) {
+ $scope.toggleMenu();
+ }
+ };
+
+ }
+ ]
+ };
+ }]);
+
+ /* istanbul ignore next */
+ if (typeof define === 'function' && define.amd) {
+ define('circular', ['angular'], circular);
+ } else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
+ module.exports = circular;
+ }
+
+})();
diff --git a/www/js/app.js b/www/js/app.js
index d7ef3f01..9831ef19 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -164,7 +164,7 @@ angular.module('zmApp', [
// First run in ionic
//------------------------------------------------------------------
-.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, $fileLogger)
+.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen, $http, $interval, zmAutoLogin, $fileLogger,$timeout)
{
ZMDataModel.init();
@@ -221,9 +221,25 @@ angular.module('zmApp', [
ZMDataModel.zmLog("Device is ready");
console.log("**** DEVICE READY ***");
- $fileLogger.deleteLogfile().then(function() {
+
+ $fileLogger.checkFile().then(function(resp) {
+ if (parseInt(resp.size) > 50000)
+ {
+ console.log ("Deleting old log file as it exceeds 50K bytes");
+ $fileLogger.deleteLogfile().then(function()
+ {
console.log('Logfile deleted');
- });
+ });
+ }
+ else
+ {
+ console.log ("Log file size is " + resp.size + " bytes");
+ }
+
+
+ });
+
+
$fileLogger.setStorageFilename('zmNinjaLog.txt');