summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/css/angular-circular-navigation.css (renamed from www/lib/angular-circular-navigation/angular-circular-navigation.css)2
-rw-r--r--www/index.html10
-rw-r--r--www/js/LogCtrl.js5
-rw-r--r--www/js/LoginCtrl.js1
-rw-r--r--www/js/angular-circular-navigation.js (renamed from www/lib/angular-circular-navigation/angular-circular-navigation.js)1
-rw-r--r--www/js/app.js22
-rw-r--r--www/lib/angular-circular-navigation/.bower.json46
-rw-r--r--www/lib/angular-circular-navigation/Gruntfile.js68
-rw-r--r--www/lib/angular-circular-navigation/LICENSE21
-rw-r--r--www/lib/angular-circular-navigation/README.md179
-rw-r--r--www/lib/angular-circular-navigation/bower.json36
-rw-r--r--www/lib/angular-circular-navigation/index.html134
-rw-r--r--www/lib/angular-circular-navigation/package.json47
-rw-r--r--www/lib/filelogger/.bower.json10
-rw-r--r--www/lib/filelogger/README.md85
-rw-r--r--www/lib/filelogger/bower.json2
-rw-r--r--www/lib/filelogger/dist/filelogger.js45
-rw-r--r--www/lib/filelogger/dist/filelogger.min.js2
-rw-r--r--www/lib/filelogger/package.json2
19 files changed, 148 insertions, 570 deletions
diff --git a/www/lib/angular-circular-navigation/angular-circular-navigation.css b/www/css/angular-circular-navigation.css
index c629e63e..0c2ee1cb 100644
--- a/www/lib/angular-circular-navigation/angular-circular-navigation.css
+++ b/www/css/angular-circular-navigation.css
@@ -1,3 +1,5 @@
+/* PP - Modified to show at right angles */
+
/* line 34, scss/angular-circular-navigation.scss */
.cn-button {
margin-top: -1.5em;
diff --git a/www/index.html b/www/index.html
index 374862fd..ce044e3c 100644
--- a/www/index.html
+++ b/www/index.html
@@ -11,12 +11,10 @@
<link href="css/style.css" rel="stylesheet">
<link href="lib/ng-mfb/mfb/src/mfb.css" rel="stylesheet">
- <link rel="stylesheet" href="lib/angular-circular-navigation/angular-circular-navigation.css">
+ <link rel="stylesheet" href="css/angular-circular-navigation.css">
<link rel="stylesheet" href="lib/font-awesome/css/font-awesome.min.css">
-
-
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
@@ -51,10 +49,8 @@
<script src="js/StateCtrl.js"></script>
<script src="js/DevOptionsCtrl.js"></script>
<script src="js/LogCtrl.js"></script>
-
-
- <script src="lib/angular-circular-navigation/angular-circular-navigation.js"></script>
-
+ <!-- https://github.com/maxklenk/angular-circular-navigation - modified to use right angles -->
+ <script src="js/angular-circular-navigation.js"></script>
<script src="lib/Chart.js/Chart.js"></script>
<script src="lib/tc-angular-chartjs/dist/tc-angular-chartjs.min.js"></script>
<script src="lib/ng-mfb/src/mfb-directive.js"></script>
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/lib/angular-circular-navigation/angular-circular-navigation.js b/www/js/angular-circular-navigation.js
index 2ec99b5c..f3b9b0a0 100644
--- a/www/lib/angular-circular-navigation/angular-circular-navigation.js
+++ b/www/js/angular-circular-navigation.js
@@ -1,3 +1,4 @@
+// PP - Modified to show at right angles
(function () {
'use strict';
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');
diff --git a/www/lib/angular-circular-navigation/.bower.json b/www/lib/angular-circular-navigation/.bower.json
deleted file mode 100644
index fecfaeaf..00000000
--- a/www/lib/angular-circular-navigation/.bower.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "angular-circular-navigation",
- "version": "0.2.1",
- "homepage": "https://github.com/maxklenk/angular-circular-navigation",
- "authors": [
- "Max Klenk <max@klenk.biz>"
- ],
- "description": "AngularJS directive for circular navigation menus",
- "main": [
- "angular-circular-navigation.js",
- "angular-circular-navigation.css"
- ],
- "keywords": [
- "angular",
- "angularJS",
- "directive",
- "circular",
- "navigation",
- "menu"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "scss",
- "demo"
- ],
- "dependencies": {
- "angular": "~1.3.x"
- },
- "devDependencies": {
- "angular-mocks": "~1.3.x"
- },
- "_release": "0.2.1",
- "_resolution": {
- "type": "version",
- "tag": "0.2.1",
- "commit": "ee6f8d03e2b7c48dafb252c6bbcef4b9d228a40d"
- },
- "_source": "git://github.com/maxklenk/angular-circular-navigation.git",
- "_target": "~0.2.1",
- "_originalSource": "angular-circular-navigation",
- "_direct": true
-}
diff --git a/www/lib/angular-circular-navigation/Gruntfile.js b/www/lib/angular-circular-navigation/Gruntfile.js
deleted file mode 100644
index 5eb11d52..00000000
--- a/www/lib/angular-circular-navigation/Gruntfile.js
+++ /dev/null
@@ -1,68 +0,0 @@
-'use strict';
-
-module.exports = function (grunt) {
-
- // load all grunt tasks
- require('load-grunt-tasks')(grunt);
-
- // default task
- grunt.registerTask('default', ['jshint', 'karma:unit']);
- grunt.registerTask('watch', ['karma:watch']);
- grunt.registerTask('coverage', ['karma:coverage', 'coveralls']);
-
-
- // perform test in Firefox on travis ci
- var testConfig = function(configFile, customOptions) {
- var options = { configFile: configFile, keepalive: true };
- var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'] };
- return grunt.util._.extend(options, customOptions, travisOptions);
- };
-
- grunt.initConfig({
-
- // Compiles Sass to CSS and generates necessary files if requested
- compass: {
- dist: {
- options: {
- sassDir: 'scss',
- cssDir: '.',
- // environment: 'production'
- }
- }
- },
-
- karma: {
- unit: {
- options: testConfig('test/karma.conf.js')
- },
- watch: {
- options: testConfig('test/karma.conf.js'),
- singleRun: false,
- autoWatch: true
- },
- coverage: {
- options: testConfig('test/karma.conf.js'),
- reporters: ['coverage']
- }
- },
-
- coveralls: {
- options: {
- debug: true,
- coverage_dir: 'coverage'
- }
- },
-
- jshint: {
- options: {
- jshintrc: '.jshintrc'
- },
- gruntfile: 'Gruntfile.js',
- angularChart: 'angular-circular-navigation.js',
- test: 'test/*.js',
- // demo: 'demo/*.js'
- }
-
- });
-
-};
diff --git a/www/lib/angular-circular-navigation/LICENSE b/www/lib/angular-circular-navigation/LICENSE
deleted file mode 100644
index 6190d32e..00000000
--- a/www/lib/angular-circular-navigation/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Max Klenk
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE. \ No newline at end of file
diff --git a/www/lib/angular-circular-navigation/README.md b/www/lib/angular-circular-navigation/README.md
deleted file mode 100644
index b219a99d..00000000
--- a/www/lib/angular-circular-navigation/README.md
+++ /dev/null
@@ -1,179 +0,0 @@
-# angular-circular-navigation [![Build Status](https://travis-ci.org/maxklenk/angular-circular-navigation.svg?branch=master)](https://travis-ci.org/maxklenk/angular-circular-navigation) [![Coverage Status](https://coveralls.io/repos/maxklenk/angular-circular-navigation/badge.png?branch=master)](https://coveralls.io/r/maxklenk/angular-circular-navigation?branch=master)
-
-**** THE CSS FILE WAS MODIFIED BY PLIABLE PIXELS TO ALLOW FOR PERFECTLY ALIGNED ANGLES FOR PTZ -- PLEASE DON'T REPLACE WITH ORIGINAL LIBRARY ****
-
-angular-circular-navigation is a [AngularJS](https://github.com/angular/angular.js) directive, which is build on top of the Tutorial [Building a circular navigation with css transform](http://tympanus.net/codrops/2013/08/09/building-a-circular-navigation-with-css-transforms/) by [Sara Soueidan](http://sarasoueidan.com/).
-
-
-## Usage [![Dependency Status](https://gemnasium.com/maxklenk/angular-circular-navigation.svg)](https://gemnasium.com/maxklenk/angular-circular-navigation)
-
-You can get it from [Bower](http://bower.io/):
-```sh
-bower install angular-circular-navigation
-```
-
-Add everything to your index.html:
-```html
-<link rel="stylesheet" href="bower_components/angular-circular-navigation/angular-circular-navigation.css">
-
-<script src="bower_components/angular/angular.js"></script>
-<script src="bower_components/angular-circular-navigation/angular-circular-navigation.js"></script>
-```
-
-And specify the directive in your module dependencies:
-```javascript
-angular.module('myApp', ['angularCircularNavigation'])
-```
-
-Add the corresponding options in your controller:
-```javascript
-$scope.options = {
- content: 'Menu',
- isOpen: false,
- toggleOnClick: true,
- items: [
- {
- content: 'About',
- onclick: function () {console.log('About');}
- }
- ]
-};
-```
-
-Then you are ready to use the directive in your view:
-```html
-<div ng-controller="Controller">
- <circular
- options="options">
- </circular>
-</div>
-```
-
-### Options
-
-The following attributes define the circular navigation menu itself and how to display each item.
-
----
-#### isOpen : boolean (default: `false`)
-Shows if the items are currently displayed or not.
-
----
-#### toggleOnClick : boolean (default: `false`)
-If `true` the menu will close when an item is clicked.
-
----
-#### background : String
-Sets the css attribute `background` for the whole menu.
-
----
-#### color : String
-Sets the css attribute `color` for the whole menu.
-
----
-#### size : String (default: `normal`)
-Possible values: `small, normal, big`
-
-
----
-#### button : Object
-Configuration of the central button which toggles the menu.
-
----
-##### button.content : String
-The text that will be rendered in the button.
-
----
-##### button.cssClass : String
-Adds css classes to the button.
-
----
-##### button.background : String
-Sets the css attribute `background` for the button.
-
----
-##### button.color : String
-Sets the css attribute `color` for the button.
-
----
-##### button.size : String (default: `normal`)
-Possible values: `small, normal, big`
-
-
----
-#### items : Array of Objects
-
----
-##### items.content : String
-The text that will be rendered in this item.
-
----
-##### items.isActive : boolean (default: `false`)
-If `true` the item is rendered more prominent.
-
----
-##### items.onclick : function
-This function will called when the item is clicked and gets the option and the item itself as attribute.
-
----
-##### items.cssClass : String
-Adds css classes to this item.
-
----
-##### items.background : String
-Sets the css attribute `background` for this item.
-
----
-##### items.color : String
-Sets the css attribute `color` for this item.
-
----
-##### button.empty : boolean (default: `false`)
-If `true` the item is not rendered.
-
-
-
-## Development
-
-We use Karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
-```sh
-npm install -g bower grunt-cli
-npm install
-grunt
-```
-
-
-## Contributing
-
-Please submit all pull requests the against develop branch. Make sure it passes the CI [![Build Status](https://travis-ci.org/maxklenk/angular-circular-navigation.svg?branch=develop)](https://travis-ci.org/maxklenk/angular-circular-navigation) and add tests to cover your code [![Coverage Status](https://coveralls.io/repos/maxklenk/angular-circular-navigation/badge.png?branch=develop)](https://coveralls.io/r/maxklenk/angular-circular-navigation?branch=develop). Thanks!
-
-## Authors
-
-**Max Klenk**
-
-+ http://github.com/maxklenk
-
-
-
-## Copyright and license
-
- The MIT License
-
- Copyright (c) 2014 Max Klenk
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
diff --git a/www/lib/angular-circular-navigation/bower.json b/www/lib/angular-circular-navigation/bower.json
deleted file mode 100644
index 4481560a..00000000
--- a/www/lib/angular-circular-navigation/bower.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "angular-circular-navigation",
- "version": "0.2.1",
- "homepage": "https://github.com/maxklenk/angular-circular-navigation",
- "authors": [
- "Max Klenk <max@klenk.biz>"
- ],
- "description": "AngularJS directive for circular navigation menus",
- "main": [
- "angular-circular-navigation.js",
- "angular-circular-navigation.css"
- ],
- "keywords": [
- "angular",
- "angularJS",
- "directive",
- "circular",
- "navigation",
- "menu"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "scss",
- "demo"
- ],
- "dependencies": {
- "angular": "~1.3.x"
- },
- "devDependencies": {
- "angular-mocks": "~1.3.x"
- }
-}
diff --git a/www/lib/angular-circular-navigation/index.html b/www/lib/angular-circular-navigation/index.html
deleted file mode 100644
index 62ed6642..00000000
--- a/www/lib/angular-circular-navigation/index.html
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html>
-<html ng-app="demoApp">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>angular-circular-navigation Demo App</title>
-
- <link rel="stylesheet" href="demo/bower_components/json-tree/json-tree.css">
- <link rel="stylesheet" href="angular-circular-navigation.css">
- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
-
- <script src="demo/bower_components/angular/angular.js"></script>
- <script src="demo/bower_components/json-tree/json-tree.js"></script>
- <script src="angular-circular-navigation.js"></script>
-
- <style type="text/css">
- html,
- body {
- height: 100%;
- background: #52be7f;
- color: #fff;
- }
-
- .component {
- position: relative;
- margin-bottom: 3em;
- height: 15em;
- background: rgba(0,0,0,0.05);
- font-family: 'Lato', Arial, sans-serif;
- }
-
- .component > h2 {
- overflow: hidden;
- width: 100%;
- text-align: center;
- text-transform: uppercase;
- white-space: nowrap;
- font-weight: 300;
- font-style: italic;
- font-size: 12em;
- opacity: 0.1;
- cursor: default;
- }
- </style>
- <script type="text/javascript">
- var app = angular.module('demoApp', ['angularCircularNavigation', 'json-tree']);
-
- app.controller('Controller', function ($scope) {
- $scope.switchAxis = function (options, clicked) {
- $scope.options.items[0].isActive = false;
- $scope.options.items[1].isActive = false;
- clicked.isActive = true;
- };
- $scope.switchColor = function (options, clicked) {
- $scope.options.items[7].isActive = false;
- $scope.options.items[8].isActive = false;
- $scope.options.items[9].isActive = false;
- clicked.isActive = true;
- $scope.options.button.background = clicked.background;
- };
- $scope.switchType = function (options, clicked) {
- $scope.options.items[3].isActive = false;
- $scope.options.items[4].isActive = false;
- $scope.options.items[5].isActive = false;
- clicked.isActive = true;
- $scope.options.button.cssClass = clicked.cssClass;
- };
-
- $scope.options = {
- isOpen: false,
- toggleOnClick: true,
- background: 'green',
- color: 'white',
- size: '',
- button: {
- content: '',
- cssClass: 'fa fa-bar-chart-o',
- background: 'red',
- color: 'white',
- size: 'small'
- },
- items: [{
- content: 'Y1',
- isActive: true,
- onclick: $scope.switchAxis
- }, {
- content: 'Y2',
- onclick: $scope.switchAxis
- }, {
- empty: true
- }, {
- cssClass: 'fa fa-bar-chart-o',
- isActive: true,
- onclick: $scope.switchType
- }, {
- cssClass: 'fa fa-camera-retro',
- onclick: $scope.switchType
- }, {
- cssClass: 'fa fa-paper-plane-o',
- onclick: $scope.switchType
- }, {
- empty: true
- }, {
- isActive: true,
- background: 'red',
- onclick: $scope.switchColor
- }, {
- background: 'blue',
- onclick: $scope.switchColor
- }, {
- background: 'yellow',
- onclick: $scope.switchColor
- }]
- };
- });
- </script>
- </head>
- <body>
- <a href="https://github.com/maxklenk/angular-circular-navigation"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
- <div ng-controller="Controller">
-
- <div class="component">
- <h2>circular</h2>
-
- <circular options="options"> </circular>
-
- </div>
-
- <h2>options:</h2>
- <json-tree json='options' collapsed-level='3'></json-tree>
-
- </div>
- </body>
-</html>
diff --git a/www/lib/angular-circular-navigation/package.json b/www/lib/angular-circular-navigation/package.json
deleted file mode 100644
index aaece5d3..00000000
--- a/www/lib/angular-circular-navigation/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "angular-circular-navigation",
- "version": "0.2.1",
- "description": "AngularJS directive for circular navigation menus",
- "main": [
- "angular-circular-navigation.js",
- "angular-circular-navigation.css"
- ],
- "scripts": {
- "test": "grunt"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/maxklenk/angular-circular-navigation.git"
- },
- "keywords": [
- "angular",
- "angularJS",
- "directive",
- "circular",
- "navigation",
- "menu"
- ],
- "author": "Max Klenk",
- "license": "MIT",
- "readmeFilename": "README.md",
- "homepage": "https://maxklenk.github.io/angular-circular-navigation",
- "bugs": {
- "url": "https://github.com/maxklenk/angular-circular-navigation/issues"
- },
- "dependencies": {
- "angular": "~1.3.0"
- },
- "devDependencies": {
- "load-grunt-tasks": "~0.6",
- "grunt": "~0.4",
- "grunt-contrib-jshint": "~0.10",
- "grunt-karma": "~0.9",
- "grunt-karma-coveralls": "~2.5",
- "grunt-contrib-compass": "~1.0.1",
- "karma": "~0.12",
- "karma-coverage": "~0.2",
- "karma-jasmine": "~0.3",
- "karma-chrome-launcher": "~0.1",
- "karma-firefox-launcher": "~0.1"
- }
-}
diff --git a/www/lib/filelogger/.bower.json b/www/lib/filelogger/.bower.json
index c063767b..2f6314c0 100644
--- a/www/lib/filelogger/.bower.json
+++ b/www/lib/filelogger/.bower.json
@@ -1,6 +1,6 @@
{
"name": "filelogger",
- "version": "1.1.0",
+ "version": "1.2.0",
"homepage": "https://github.com/pbakondy/filelogger",
"authors": [
"Peter Bakondy <pbakondy@gmail.com>"
@@ -27,14 +27,14 @@
"file logger"
],
"license": "MIT",
- "_release": "1.1.0",
+ "_release": "1.2.0",
"_resolution": {
"type": "version",
- "tag": "v1.1.0",
- "commit": "4b5f765cf1737a51cc29bcaeca035d72eb6e8272"
+ "tag": "v1.2.0",
+ "commit": "34d8cc57c16c842ec757cc078e9385286b2ff1c4"
},
"_source": "git://github.com/pbakondy/filelogger.git",
- "_target": "~1.1.0",
+ "_target": "~1.2.0",
"_originalSource": "filelogger",
"_direct": true
}
diff --git a/www/lib/filelogger/README.md b/www/lib/filelogger/README.md
index 1d6c6456..b1e3c20f 100644
--- a/www/lib/filelogger/README.md
+++ b/www/lib/filelogger/README.md
@@ -12,10 +12,16 @@ When you run your application in browser with „ionic serve” the Logger uses
## Dependencies
- [ngCordova](http://ngcordova.com/) ( required version v0.1.14-alpha )
-- [org.apache.cordova.file](https://github.com/apache/cordova-plugin-file)
+- [cordova-plugin-file](https://github.com/apache/cordova-plugin-file)
## Installation
+Add cordova plugin:
+
+```bash
+$ cordova plugin add cordova-plugin-file
+```
+
Install manually, or from bower:
```bash
@@ -35,30 +41,30 @@ Comment: you don't have to use the complete ngCordova package. I suggest to crea
## Usage
-### $fileLogger.log()
+### $fileLogger.log(level, ...message)
General logger method. The first parameter is the log level (debug, info, warn, error). The following parameters are the message parts.
You can put here any javascript type (string, number, boolean, object, array).
In the logfile every item starts with the current UTC timestamp, followed by the log level and the message.
-### $fileLogger.debug()
+### $fileLogger.debug(...message)
Wrapper for $fileLogger.log('debug', ...)
-### $fileLogger.info()
+### $fileLogger.info(...message)
Wrapper for $fileLogger.log('info', ...)
-### $fileLogger.warn()
+### $fileLogger.warn(...message)
Wrapper for $fileLogger.log('warn', ...)
-### $fileLogger.error()
+### $fileLogger.error(...message)
Wrapper for $fileLogger.log('error', ...)
-### $fileLogger.setStorageFilename()
+### $fileLogger.setStorageFilename(filename)
You can set the local filename (default messages.log). It requests one parameter, the filename (type string).
@@ -70,13 +76,49 @@ You can read the whole logfile from the filestore. This method returns a promise
You can delete the logfile from the filestore. This method returns a promise.
+### $fileLogger.checkFile()
+Get storage file data. This method returns an object.
+
+```js
+// response on iOS
+{
+ "name": "myLog.txt",
+ "localURL": "cdvfile://localhost/library-nosync/myLog.txt",
+ "type": null,
+ "lastModified": 1435668606000,
+ "lastModifiedDate": 1435668606000,
+ "size": 450,
+ "start": 0,
+ "end": 450
+}
+
+// response on Android
+{
+ "name": "myLog.txt",
+ "localURL": "cdvfile://localhost/files/myLog.txt",
+ "type": "text/plain",
+ "lastModified": 1435669292000,
+ "lastModifiedDate": 1435669292000,
+ "size": 450,
+ "start": 0,
+ "end": 450
+}
+
+// response in Browser
+{
+ "name": "myLog.txt",
+ "localURL": "localStorage://localhost/myLog.txt",
+ "type": "text/plain",
+ "size": 450
+}
+```
### Example use
```js
angular.module('starter', ['ionic', 'fileLogger'])
- .controller('mainCtrl', ['$scope', '$fileLogger', function($scope, $fileLogger) {
+ .controller('mainCtrl', ['$scope', '$fileLogger', '$timeout', function($scope, $fileLogger, $timeout) {
function testing() {
@@ -96,14 +138,25 @@ angular.module('starter', ['ionic', 'fileLogger'])
$fileLogger.log('info', 'message', 123, [1, 2, 3], { a: 1, b: '2' });
- $fileLogger.getLogfile().then(function(l) {
- console.log('Logfile content');
- console.log(l);
- });
-
- $fileLogger.deleteLogfile().then(function() {
- console.log('Logfile deleted');
- });
+ $timeout(function(){
+ $fileLogger.getLogfile().then(function(l) {
+ console.log('Logfile content');
+ console.log(l);
+ });
+ }, 1000);
+
+ $timeout(function(){
+ $fileLogger.checkFile().then(function(d) {
+ console.log('Logfile data');
+ console.log(JSON.stringify(d));
+ });
+ }, 2000);
+
+ $timeout(function(){
+ $fileLogger.deleteLogfile().then(function() {
+ console.log('Logfile deleted');
+ });
+ }, 3000);
}
diff --git a/www/lib/filelogger/bower.json b/www/lib/filelogger/bower.json
index d6a109bd..fb4b8fe2 100644
--- a/www/lib/filelogger/bower.json
+++ b/www/lib/filelogger/bower.json
@@ -1,6 +1,6 @@
{
"name": "filelogger",
- "version": "1.1.0",
+ "version": "1.2.0",
"homepage": "https://github.com/pbakondy/filelogger",
"authors": [
"Peter Bakondy <pbakondy@gmail.com>"
diff --git a/www/lib/filelogger/dist/filelogger.js b/www/lib/filelogger/dist/filelogger.js
index c266f22a..28852fa8 100644
--- a/www/lib/filelogger/dist/filelogger.js
+++ b/www/lib/filelogger/dist/filelogger.js
@@ -6,11 +6,13 @@
(function(){
/* global angular, console, cordova */
-// install : cordova plugin add org.apache.cordova.file
+// install : cordova plugin add cordova-plugin-file
angular.module('fileLogger', ['ngCordova.plugins.file'])
- .factory('$fileLogger', ['$q', '$window', '$cordovaFile', '$timeout', function ($q, $window, $cordovaFile, $timeout) {
+ .factory('$fileLogger', ['$q', '$window', '$cordovaFile', '$timeout',
+ function ($q, $window, $cordovaFile, $timeout) {
+
'use strict';
@@ -41,13 +43,24 @@ angular.module('fileLogger', ['ngCordova.plugins.file'])
var messages = Array.prototype.slice.call(arguments, 1);
var message = [ timestamp, level ];
+ var text;
for (var i = 0; i < messages.length; i++ ) {
if (angular.isArray(messages[i])) {
- message.push(JSON.stringify(messages[i]));
+ text = '[Array]';
+ try {
+ // avoid "TypeError: Converting circular structure to JSON"
+ text = JSON.stringify(messages[i]);
+ } catch(e) {}
+ message.push(text);
}
else if (angular.isObject(messages[i])) {
- message.push(JSON.stringify(messages[i]));
+ text = '[Object]';
+ try {
+ // avoid "TypeError: Converting circular structure to JSON"
+ text = JSON.stringify(messages[i]);
+ } catch(e) {}
+ message.push(text);
}
else {
message.push(messages[i]);
@@ -230,6 +243,29 @@ angular.module('fileLogger', ['ngCordova.plugins.file'])
}
+ function checkFile() {
+ var q = $q.defer();
+
+ if (isBrowser()) {
+
+ q.resolve({
+ 'name': storageFilename,
+ 'localURL': 'localStorage://localhost/' + storageFilename,
+ 'type': 'text/plain',
+ 'size': ($window.localStorage[storageFilename] ? $window.localStorage[storageFilename].length : 0)
+ });
+
+ } else {
+
+ $cordovaFile.checkFile(cordova.file.dataDirectory, storageFilename).then(function(fileEntry) {
+ fileEntry.file(q.resolve, q.reject);
+ }, q.reject);
+
+ }
+
+ return q.promise;
+ }
+
function debug() {
var args = Array.prototype.slice.call(arguments, 0);
args.unshift('DEBUG');
@@ -263,6 +299,7 @@ angular.module('fileLogger', ['ngCordova.plugins.file'])
getLogfile: getLogfile,
deleteLogfile: deleteLogfile,
setStorageFilename: setStorageFilename,
+ checkFile: checkFile,
debug: debug,
info: info,
warn: warn,
diff --git a/www/lib/filelogger/dist/filelogger.min.js b/www/lib/filelogger/dist/filelogger.min.js
index 366521a2..b0f555a3 100644
--- a/www/lib/filelogger/dist/filelogger.min.js
+++ b/www/lib/filelogger/dist/filelogger.min.js
@@ -3,4 +3,4 @@
* Copyright 2015 Peter Bakondy https://github.com/pbakondy
* See LICENSE in this repository for license information
*/
-!function(){angular.module("fileLogger",["ngCordova.plugins.file"]).factory("$fileLogger",["$q","$window","$cordovaFile","$timeout",function(e,o,n,r){"use strict";function l(){return!o.cordova&&!o.PhoneGap&&!o.phonegap}function t(e){angular.isString(e)?(e=e.toUpperCase(),-1===h.indexOf(e)&&(e="INFO")):e="INFO";for(var o=(new Date).toJSON(),n=Array.prototype.slice.call(arguments,1),r=[o,e],t=0;t<n.length;t++)r.push(angular.isArray(n[t])?JSON.stringify(n[t]):angular.isObject(n[t])?JSON.stringify(n[t]):n[t]);if(l()){if(n.unshift(o),angular.isObject(console)&&angular.isFunction(console.log))switch(e){case"DEBUG":angular.isFunction(console.debug)?console.debug.apply(console,n):console.log.apply(console,n);break;case"INFO":angular.isFunction(console.debug)?console.info.apply(console,n):console.log.apply(console,n);break;case"WARN":angular.isFunction(console.debug)?console.warn.apply(console,n):console.log.apply(console,n);break;case"ERROR":angular.isFunction(console.debug)?console.error.apply(console,n):console.log.apply(console,n);break;default:console.log.apply(console,n)}}else console.log(r.join(" "));v.push({message:r.join(" ")+"\n"}),y||a()}function a(){if(!v.length)return void(y=!1);y=!0;var e=v.shift();i(e.message).then(function(){r(function(){a()})},function(){r(function(){a()})})}function i(r){var t=e.defer();return l()?(o.localStorage[m]||(o.localStorage[m]=""),o.localStorage[m]+=r,t.resolve()):n.checkFile(cordova.file.dataDirectory,m).then(function(){n.writeExistingFile(cordova.file.dataDirectory,m,r).then(function(){t.resolve()},function(e){t.reject(e)})},function(){n.writeFile(cordova.file.dataDirectory,m,r,!0).then(function(){t.resolve()},function(e){t.reject(e)})}),t.promise}function c(){var r=e.defer();return l()?r.resolve(o.localStorage[m]):n.readAsText(cordova.file.dataDirectory,m).then(function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}function s(){var r=e.defer();return l()?(o.localStorage.removeItem(m),r.resolve()):n.removeFile(cordova.file.dataDirectory,m).then(function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}function u(e){return angular.isString(e)&&e.length>0?(m=e,!0):!1}function g(){var e=Array.prototype.slice.call(arguments,0);e.unshift("DEBUG"),t.apply(void 0,e)}function f(){var e=Array.prototype.slice.call(arguments,0);e.unshift("INFO"),t.apply(void 0,e)}function p(){var e=Array.prototype.slice.call(arguments,0);e.unshift("WARN"),t.apply(void 0,e)}function d(){var e=Array.prototype.slice.call(arguments,0);e.unshift("ERROR"),t.apply(void 0,e)}var v=[],y=!1,h=["DEBUG","INFO","WARN","ERROR"],m="messages.log";return{log:t,getLogfile:c,deleteLogfile:s,setStorageFilename:u,debug:g,info:f,warn:p,error:d}}])}();
+!function(){angular.module("fileLogger",["ngCordova.plugins.file"]).factory("$fileLogger",["$q","$window","$cordovaFile","$timeout",function(e,o,n,r){"use strict";function l(){return!o.cordova&&!o.PhoneGap&&!o.phonegap}function t(e){angular.isString(e)?(e=e.toUpperCase(),-1===m.indexOf(e)&&(e="INFO")):e="INFO";for(var o,n=(new Date).toJSON(),r=Array.prototype.slice.call(arguments,1),t=[n,e],c=0;c<r.length;c++)if(angular.isArray(r[c])){o="[Array]";try{o=JSON.stringify(r[c])}catch(i){}t.push(o)}else if(angular.isObject(r[c])){o="[Object]";try{o=JSON.stringify(r[c])}catch(i){}t.push(o)}else t.push(r[c]);if(l()){if(r.unshift(n),angular.isObject(console)&&angular.isFunction(console.log))switch(e){case"DEBUG":angular.isFunction(console.debug)?console.debug.apply(console,r):console.log.apply(console,r);break;case"INFO":angular.isFunction(console.debug)?console.info.apply(console,r):console.log.apply(console,r);break;case"WARN":angular.isFunction(console.debug)?console.warn.apply(console,r):console.log.apply(console,r);break;case"ERROR":angular.isFunction(console.debug)?console.error.apply(console,r):console.log.apply(console,r);break;default:console.log.apply(console,r)}}else console.log(t.join(" "));v.push({message:t.join(" ")+"\n"}),h||a()}function a(){if(!v.length)return void(h=!1);h=!0;var e=v.shift();c(e.message).then(function(){r(function(){a()})},function(){r(function(){a()})})}function c(r){var t=e.defer();return l()?(o.localStorage[F]||(o.localStorage[F]=""),o.localStorage[F]+=r,t.resolve()):n.checkFile(cordova.file.dataDirectory,F).then(function(){n.writeExistingFile(cordova.file.dataDirectory,F,r).then(function(){t.resolve()},function(e){t.reject(e)})},function(){n.writeFile(cordova.file.dataDirectory,F,r,!0).then(function(){t.resolve()},function(e){t.reject(e)})}),t.promise}function i(){var r=e.defer();return l()?r.resolve(o.localStorage[F]):n.readAsText(cordova.file.dataDirectory,F).then(function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}function s(){var r=e.defer();return l()?(o.localStorage.removeItem(F),r.resolve()):n.removeFile(cordova.file.dataDirectory,F).then(function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}function u(e){return angular.isString(e)&&e.length>0?(F=e,!0):!1}function f(){var r=e.defer();return l()?r.resolve({name:F,localURL:"localStorage://localhost/"+F,type:"text/plain",size:o.localStorage[F]?o.localStorage[F].length:0}):n.checkFile(cordova.file.dataDirectory,F).then(function(e){e.file(r.resolve,r.reject)},r.reject),r.promise}function g(){var e=Array.prototype.slice.call(arguments,0);e.unshift("DEBUG"),t.apply(void 0,e)}function p(){var e=Array.prototype.slice.call(arguments,0);e.unshift("INFO"),t.apply(void 0,e)}function y(){var e=Array.prototype.slice.call(arguments,0);e.unshift("WARN"),t.apply(void 0,e)}function d(){var e=Array.prototype.slice.call(arguments,0);e.unshift("ERROR"),t.apply(void 0,e)}var v=[],h=!1,m=["DEBUG","INFO","WARN","ERROR"],F="messages.log";return{log:t,getLogfile:i,deleteLogfile:s,setStorageFilename:u,checkFile:f,debug:g,info:p,warn:y,error:d}}])}();
diff --git a/www/lib/filelogger/package.json b/www/lib/filelogger/package.json
index 0f1619a0..165d6598 100644
--- a/www/lib/filelogger/package.json
+++ b/www/lib/filelogger/package.json
@@ -2,7 +2,7 @@
"name": "filelogger",
"private": false,
"main": "dist/filelogger",
- "version": "1.1.0",
+ "version": "1.2.0",
"repository": {
"url": "git://github.com/pbakondy/filelogger.git"
},