From a29f9a676a6ea3bad56ede05cd1a1c82ffbbe8e9 Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Sun, 10 Apr 2016 10:47:35 -0400 Subject: #219 - everything upgraded Former-commit-id: 15f58d10df83feda8199a1b904433e625ef36b44 --- www/lib/filelogger/.bower.json | 17 ++++++++-------- www/lib/filelogger/README.md | 14 +++++++++---- www/lib/filelogger/bower.json | 6 +++--- www/lib/filelogger/dist/filelogger.js | 33 ++++++++++++++++++++++++++++--- www/lib/filelogger/dist/filelogger.min.js | 4 ++-- www/lib/filelogger/package.json | 31 ++++++++++++++++------------- 6 files changed, 70 insertions(+), 35 deletions(-) (limited to 'www/lib/filelogger') diff --git a/www/lib/filelogger/.bower.json b/www/lib/filelogger/.bower.json index ff9be55e..806271c7 100644 --- a/www/lib/filelogger/.bower.json +++ b/www/lib/filelogger/.bower.json @@ -1,11 +1,11 @@ { "name": "filelogger", - "version": "1.3.0", + "version": "1.3.1", "homepage": "https://github.com/pbakondy/filelogger", "authors": [ "Peter Bakondy " ], - "description": "Cordova library to log messages to local filesystem", + "description": "Ionic library to log messages to local filesystem", "main": "./dist/filelogger.min.js", "ignore": [ "**/.*", @@ -14,7 +14,7 @@ "config" ], "dependencies": { - "ngCordova": ">= 0.1.14-alpha" + "ngCordova": ">= 0.1.24-alpha" }, "keywords": [ "cordova", @@ -27,14 +27,13 @@ "file logger" ], "license": "MIT", - "_release": "1.3.0", + "_release": "1.3.1", "_resolution": { "type": "version", - "tag": "v1.3.0", - "commit": "9500dca94558ffb27de6416c6031ddf54e183265" + "tag": "v1.3.1", + "commit": "420508b796674ca0f96da0bc04d80a627f9aebbe" }, - "_source": "git://github.com/pbakondy/filelogger.git", + "_source": "https://github.com/pbakondy/filelogger.git", "_target": "~1.3.0", - "_originalSource": "filelogger", - "_direct": true + "_originalSource": "filelogger" } \ No newline at end of file diff --git a/www/lib/filelogger/README.md b/www/lib/filelogger/README.md index e0e29aa3..0fe3054d 100644 --- a/www/lib/filelogger/README.md +++ b/www/lib/filelogger/README.md @@ -1,9 +1,9 @@ -Cordova File Logger +Ionic File Logger ========== [![Bower](http://img.shields.io/badge/bower-filelogger-FFCC2F.svg?style=flat)](http://bower.io/search/?q=filelogger) -Logger module for Cordova/Ionic projects. +Logger module for Ionic projects. When you run your application in device the Logger writes in the local filesystem (with cordova-plugin-file) and the system logs (with console.log). @@ -11,7 +11,7 @@ When you run your application in browser with „ionic serve” the Logger uses ## Dependencies -- [ngCordova](http://ngcordova.com/) ( required version v0.1.14-alpha ) +- [ngCordova](http://ngcordova.com/) ( required version v0.1.24-alpha ) - [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) ## Installation @@ -28,6 +28,12 @@ Install manually, or from bower: $ bower install filelogger ``` +Install with npm: + +```bash +$ npm install ionic-filelogger +``` + Include *filelogger.min.js* and ng-cordova.js or *ng-cordova.min.js* in your index.html file before cordova.js and after your AngularJS / Ionic file (since ngCordova depends on AngularJS). ```html @@ -181,4 +187,4 @@ angular.module('starter', ['ionic', 'fileLogger']) ## LICENSE -Cordova File Logger is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository. +Ionic File Logger is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository. diff --git a/www/lib/filelogger/bower.json b/www/lib/filelogger/bower.json index 3ec2e262..84f96637 100644 --- a/www/lib/filelogger/bower.json +++ b/www/lib/filelogger/bower.json @@ -1,11 +1,11 @@ { "name": "filelogger", - "version": "1.3.0", + "version": "1.3.1", "homepage": "https://github.com/pbakondy/filelogger", "authors": [ "Peter Bakondy " ], - "description": "Cordova library to log messages to local filesystem", + "description": "Ionic library to log messages to local filesystem", "main": "./dist/filelogger.min.js", "ignore": [ "**/.*", @@ -14,7 +14,7 @@ "config" ], "dependencies": { - "ngCordova": ">= 0.1.14-alpha" + "ngCordova": ">= 0.1.24-alpha" }, "keywords": [ "cordova", diff --git a/www/lib/filelogger/dist/filelogger.js b/www/lib/filelogger/dist/filelogger.js index fa5f2625..8a90ab5c 100644 --- a/www/lib/filelogger/dist/filelogger.js +++ b/www/lib/filelogger/dist/filelogger.js @@ -1,10 +1,11 @@ /*! * fileLogger - * Copyright 2015 Peter Bakondy https://github.com/pbakondy + * Copyright 2016 Peter Bakondy https://github.com/pbakondy * See LICENSE in this repository for license information */ (function(){ /* global angular, console, cordova */ +/* eslint no-console:0 */ // install : cordova plugin add cordova-plugin-file // date format: https://docs.angularjs.org/api/ng/filter/date @@ -57,7 +58,9 @@ angular.module('fileLogger', ['ngCordova.plugins.file']) try { // avoid "TypeError: Converting circular structure to JSON" text = JSON.stringify(messages[i]); - } catch(e) {} + } catch(e) { + // do nothing + } message.push(text); } else if (angular.isObject(messages[i])) { @@ -65,7 +68,9 @@ angular.module('fileLogger', ['ngCordova.plugins.file']) try { // avoid "TypeError: Converting circular structure to JSON" text = JSON.stringify(messages[i]); - } catch(e) {} + } catch(e) { + // do nothing + } message.push(text); } else { @@ -167,6 +172,11 @@ angular.module('fileLogger', ['ngCordova.plugins.file']) } else { + if (!$window.cordova || !$window.cordova.file || !$window.cordova.file.dataDirectory) { + q.reject('cordova.file.dataDirectory is not available'); + return q.promise; + } + $cordovaFile.checkFile(cordova.file.dataDirectory, storageFilename).then( function() { // writeExistingFile(path, fileName, text) @@ -204,6 +214,12 @@ angular.module('fileLogger', ['ngCordova.plugins.file']) if (isBrowser()) { q.resolve($window.localStorage[storageFilename]); } else { + + if (!$window.cordova || !$window.cordova.file || !$window.cordova.file.dataDirectory) { + q.reject('cordova.file.dataDirectory is not available'); + return q.promise; + } + $cordovaFile.readAsText(cordova.file.dataDirectory, storageFilename).then( function(result) { q.resolve(result); @@ -225,6 +241,12 @@ angular.module('fileLogger', ['ngCordova.plugins.file']) $window.localStorage.removeItem(storageFilename); q.resolve(); } else { + + if (!$window.cordova || !$window.cordova.file || !$window.cordova.file.dataDirectory) { + q.reject('cordova.file.dataDirectory is not available'); + return q.promise; + } + $cordovaFile.removeFile(cordova.file.dataDirectory, storageFilename).then( function(result) { q.resolve(result); @@ -276,6 +298,11 @@ angular.module('fileLogger', ['ngCordova.plugins.file']) } else { + if (!$window.cordova || !$window.cordova.file || !$window.cordova.file.dataDirectory) { + q.reject('cordova.file.dataDirectory is not available'); + return q.promise; + } + $cordovaFile.checkFile(cordova.file.dataDirectory, storageFilename).then(function(fileEntry) { fileEntry.file(q.resolve, q.reject); }, q.reject); diff --git a/www/lib/filelogger/dist/filelogger.min.js b/www/lib/filelogger/dist/filelogger.min.js index 4fd8ec79..de02b863 100644 --- a/www/lib/filelogger/dist/filelogger.min.js +++ b/www/lib/filelogger/dist/filelogger.min.js @@ -1,6 +1,6 @@ /*! * fileLogger - * Copyright 2015 Peter Bakondy https://github.com/pbakondy + * Copyright 2016 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","$filter",function(e,o,n,r,t){"use strict";function a(){return!o.cordova&&!o.PhoneGap&&!o.phonegap}function l(e){angular.isString(e)?(e=e.toUpperCase(),-1===O.indexOf(e)&&(e="INFO")):e="INFO";for(var o,n=new Date,r=m?t("date")(n,m,F):n.toJSON(),l=Array.prototype.slice.call(arguments,1),c=[r,e],s=0;s0?(R=e,!0):!1}function g(e,o){if(!angular.isUndefined(e)&&!angular.isString(e))throw new TypeError("format parameter must be a string or undefined");if(!angular.isUndefined(o)&&!angular.isString(o))throw new TypeError("timezone parameter must be a string or undefined");m=e,F=o}function p(){var r=e.defer();return a()?r.resolve({name:R,localURL:"localStorage://localhost/"+R,type:"text/plain",size:o.localStorage[R]?o.localStorage[R].length:0}):n.checkFile(cordova.file.dataDirectory,R).then(function(e){e.file(r.resolve,r.reject)},r.reject),r.promise}function d(){var e=Array.prototype.slice.call(arguments,0);e.unshift("DEBUG"),l.apply(void 0,e)}function y(){var e=Array.prototype.slice.call(arguments,0);e.unshift("INFO"),l.apply(void 0,e)}function v(){var e=Array.prototype.slice.call(arguments,0);e.unshift("WARN"),l.apply(void 0,e)}function h(){var e=Array.prototype.slice.call(arguments,0);e.unshift("ERROR"),l.apply(void 0,e)}var m,F,S=[],b=!1,O=["DEBUG","INFO","WARN","ERROR"],R="messages.log";return{log:l,getLogfile:s,deleteLogfile:u,setStorageFilename:f,setTimestampFormat:g,checkFile:p,debug:d,info:y,warn:v,error:h}}])}(); \ No newline at end of file +!function(){angular.module("fileLogger",["ngCordova.plugins.file"]).factory("$fileLogger",["$q","$window","$cordovaFile","$timeout","$filter",function(e,o,r,a,n){"use strict";function t(){return!o.cordova&&!o.PhoneGap&&!o.phonegap}function i(e){angular.isString(e)?(e=e.toUpperCase(),-1===S.indexOf(e)&&(e="INFO")):e="INFO";for(var o,r=new Date,a=m?n("date")(r,m,b):r.toJSON(),i=Array.prototype.slice.call(arguments,1),c=[a,e],s=0;s0?(j=e,!0):!1}function g(e,o){if(!angular.isUndefined(e)&&!angular.isString(e))throw new TypeError("format parameter must be a string or undefined");if(!angular.isUndefined(o)&&!angular.isString(o))throw new TypeError("timezone parameter must be a string or undefined");m=e,b=o}function d(){var a=e.defer();if(t())a.resolve({name:j,localURL:"localStorage://localhost/"+j,type:"text/plain",size:o.localStorage[j]?o.localStorage[j].length:0});else{if(!o.cordova||!o.cordova.file||!o.cordova.file.dataDirectory)return a.reject("cordova.file.dataDirectory is not available"),a.promise;r.checkFile(cordova.file.dataDirectory,j).then(function(e){e.file(a.resolve,a.reject)},a.reject)}return a.promise}function p(){var e=Array.prototype.slice.call(arguments,0);e.unshift("DEBUG"),i.apply(void 0,e)}function v(){var e=Array.prototype.slice.call(arguments,0);e.unshift("INFO"),i.apply(void 0,e)}function y(){var e=Array.prototype.slice.call(arguments,0);e.unshift("WARN"),i.apply(void 0,e)}function h(){var e=Array.prototype.slice.call(arguments,0);e.unshift("ERROR"),i.apply(void 0,e)}var m,b,F=[],D=!1,S=["DEBUG","INFO","WARN","ERROR"],j="messages.log";return{log:i,getLogfile:s,deleteLogfile:f,setStorageFilename:u,setTimestampFormat:g,checkFile:d,debug:p,info:v,warn:y,error:h}}])}(); \ No newline at end of file diff --git a/www/lib/filelogger/package.json b/www/lib/filelogger/package.json index a3cc3938..27dac364 100644 --- a/www/lib/filelogger/package.json +++ b/www/lib/filelogger/package.json @@ -1,26 +1,29 @@ { - "name": "filelogger", + "name": "ionic-filelogger", "private": false, "main": "dist/filelogger", - "version": "1.3.0", + "version": "1.3.1", "repository": { - "url": "git://github.com/pbakondy/filelogger.git" + "type": "git", + "url": "https://github.com/pbakondy/filelogger.git" }, "devDependencies": { - "gulp": "^3.7.0", + "gulp": "^3.9.1", "gulp-footer": "^1.0.4", "gulp-header": "^1.0.2", - "gulp-jshint": "^1.6.1", + "gulp-jshint": "^2.0.0", "gulp-rename": "^1.2.0", - "gulp-uglify": "^0.2.1", - "jshint-stylish": "^0.4.0", - "minimist": "^0.1.0" + "gulp-uglify": "^1.5.3", + "jshint": "^2.8.0", + "jshint-stylish": "^2.1.0", + "minimist": "^1.2.0" }, - "licenses": [ - { - "type": "MIT" - } - ], + "license": "MIT", "dependencies": { - } + "ng-cordova": "^0.1.24-alpha" + }, + "bugs": { + "url": "https://github.com/pbakondy/filelogger/issues" + }, + "homepage": "https://github.com/pbakondy/filelogger#readme" } -- cgit v1.2.3