diff --git a/config.xml b/config.xml index f6edef751eadb95af01bd077d82e50e3a331dda3..8a8418722bba8822799f394ab248c1c1f6d5f645 100644 --- a/config.xml +++ b/config.xml @@ -93,10 +93,10 @@ <plugin name="cordova-plugin-device" spec="~1.1.2" /> <plugin name="cordova-plugin-dialogs" spec="~1.2.1" /> <plugin name="cordova-plugin-inappbrowser" spec="~1.6.1" /> + <plugin name="cordova-plugin-minisodium" spec="~1.0.0" /> <plugin name="cordova-plugin-secure-storage" spec="~2.6.3" /> <plugin name="cordova-plugin-splashscreen" spec="~3.2.2" /> <plugin name="cordova-plugin-statusbar" spec="~2.1.3" /> - <plugin name="cordova-plugin-vibration" spec="~2.1.1" /> <plugin name="cordova-plugin-websocket" spec="~0.12.0" /> <plugin name="cordova-plugin-whitelist" spec="~1.2.2" /> <plugin name="cordova-plugin-x-toast" spec="~2.6.0" /> @@ -104,5 +104,4 @@ <plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git"> <variable name="CAMERA_USAGE_DESCRIPTION" value=" " /> </plugin> - <plugin name="cordova-plugin-minisodium" spec="~1.0.0" /> </widget> diff --git a/package.json b/package.json index e18273030f59e06b65d4353691d60ff1d75a2dd3..c1558667ee4e332838fc2cf20c9edc50474e9661 100644 --- a/package.json +++ b/package.json @@ -27,15 +27,30 @@ "new": "https://github.com/duniter/cesium/issues/new?labels=bug" }, "dependencies": { + "bower": "^1.8.0", + "cordova-plugin-camera": "~2.2.0", + "cordova-plugin-console": "~1.0.3", + "cordova-plugin-device": "~1.1.2", + "cordova-plugin-dialogs": "~1.2.1", + "cordova-plugin-inappbrowser": "~1.6.1", + "cordova-plugin-minisodium": "~1.0.0", + "cordova-plugin-secure-storage": "~2.6.3", + "cordova-plugin-splashscreen": "~3.2.2", + "cordova-plugin-statusbar": "~2.1.3", + "cordova-plugin-vibration": "~2.1.1", + "cordova-plugin-websocket": "~0.12.0", + "cordova-plugin-whitelist": "~1.2.2", + "cordova-plugin-x-toast": "~2.6.0", "delete-empty": "^0.1.3", "gulp": "^3.9.1", - "bower": "^1.7.3", - "ionic": "^1.7.16", "gulp-bump": "^2.1.0", "gulp-concat": "^2.2.0", "gulp-rename": "^1.2.0", "gulp-sass": "^2.2.0", - "node-sass": "^3.3.3" + "ionic": "^1.7.16", + "ionic-plugin-keyboard": "~2.2.1", + "node-sass": "^3.3.3", + "phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git" }, "devDependencies": { "cordova-uglify": "^0.2.3", @@ -96,5 +111,26 @@ "ios", "android", "firefoxos" - ] + ], + "cordova": { + "plugins": { + "cordova-plugin-camera": {}, + "cordova-plugin-console": {}, + "cordova-plugin-device": {}, + "cordova-plugin-dialogs": {}, + "cordova-plugin-inappbrowser": {}, + "cordova-plugin-minisodium": {}, + "cordova-plugin-secure-storage": {}, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-statusbar": {}, + "cordova-plugin-vibration": {}, + "cordova-plugin-websocket": {}, + "cordova-plugin-whitelist": {}, + "cordova-plugin-x-toast": {}, + "ionic-plugin-keyboard": {}, + "phonegap-plugin-barcodescanner": { + "CAMERA_USAGE_DESCRIPTION": " " + } + } + } } diff --git a/www/js/app.js b/www/js/app.js index 15bcf40a736793226b1efdbbd1e923415bd32560..f9b47fedecc53cd6db04ec670f7586a8a0ce89c6 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -5,7 +5,7 @@ // the 2nd parameter is an array of 'requires' // 'starter.controllers' is found in controllers.js angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht.translate', - 'ngApi', 'angular-cache', 'angular.screenmatch', 'angular.bind.notifier', 'ImageCropper', 'ngFileSaver', + 'ngApi', 'angular-cache', 'angular.screenmatch', 'angular.bind.notifier', 'ImageCropper', // removeIf(no-device) 'ngCordova', // endRemoveIf(no-device) @@ -85,11 +85,11 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht IdleProvider.timeout(csConfig.logoutTimeout||15); // display warning during 15s }) - .factory('$exceptionHandler', function($log) { + .factory('$exceptionHandler', function() { 'ngInject'; return function(exception, cause) { - $log.error(exception, cause); + console.error(exception, cause); }; }) diff --git a/www/js/controllers/currency-controllers.js b/www/js/controllers/currency-controllers.js index 1a23d5254ee5d512bf8922e2f6cbca963b6974c2..9a1b537e794e45a9872242bb60cda750cdd08e63 100644 --- a/www/js/controllers/currency-controllers.js +++ b/www/js/controllers/currency-controllers.js @@ -1,5 +1,5 @@ -angular.module('cesium.currency.controllers', ['cesium.services']) +angular.module('cesium.currency.controllers', ['ngFileSaver', 'cesium.services']) .config(function($stateProvider) { 'ngInject'; diff --git a/www/js/filters.js b/www/js/filters.js index eddc66acf40c76389a3b02a2320d525d6bcf1f63..202a0d749474921109d70dcb8884dd81de5e47ac 100644 --- a/www/js/filters.js +++ b/www/js/filters.js @@ -1,8 +1,8 @@ // Cesium filters -angular.module('cesium.filters', ['cesium.config', 'cesium.settings.services', 'pascalprecht.translate', 'cesium.translations' +angular.module('cesium.filters', ['cesium.config', 'cesium.platform', 'pascalprecht.translate', 'cesium.translations' ]) - .service('filterTranslations', function($rootScope, csSettings, $translate) { + .service('filterTranslations', function($rootScope, csPlatform, csSettings, $translate) { 'ngInject'; var @@ -34,7 +34,6 @@ angular.module('cesium.filters', ['cesium.config', 'cesium.settings.services', ' } }); } - csSettings.api.locale.on.changed($rootScope, onLocaleChange, this); that.ready = function() { if (started) return $q.when(data); @@ -42,10 +41,12 @@ angular.module('cesium.filters', ['cesium.config', 'cesium.settings.services', ' }; that.start = function() { - startPromise = csSettings.ready() + startPromise = csPlatform.ready() .then(onLocaleChange) .then(function() { started = true; + + csSettings.api.locale.on.changed($rootScope, onLocaleChange, this); }); return startPromise; }; diff --git a/www/js/platform.js b/www/js/platform.js index 9ea3fb1db3f78b01c55920c40a16c9dd10d918bf..5c7b07425aa587544423d65d8555ffe79125ed93 100644 --- a/www/js/platform.js +++ b/www/js/platform.js @@ -110,19 +110,19 @@ angular.module('cesium.platform', ['cesium.config', 'cesium.services']) Device.ready(), // Start settings - csSettings.start() + csSettings.ready() ])) // Load BMA .then(function(){ - return BMA.start().then(checkBmaNodeAlive); + return BMA.ready().then(checkBmaNodeAlive); }) // Load currency - .then(csCurrency.start) + .then(csCurrency.ready) // Trying to restore wallet - .then(csWallet.start) + .then(csWallet.ready) .then(function(){ enableChangeState(); diff --git a/www/js/services/bma-services.js b/www/js/services/bma-services.js index a413fef9d485f3cca88c08109be841cb38203b93..032124c57756ea2211c02c5366de6096689d01d6 100644 --- a/www/js/services/bma-services.js +++ b/www/js/services/bma-services.js @@ -72,7 +72,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. that.cache = _emptyCache(); // Allow to force SSL connection with port different from 443 - var forceUseSsl = (csConfig.httpsMode == true || csConfig.httpsMode === 'force') || + var forceUseSsl = (csConfig.httpsMode === 'true' || csConfig.httpsMode === true || csConfig.httpsMode === 'force') || ($window.location && $window.location.protocol === 'https:') ? true : false; if (forceUseSsl) { console.debug('[BMA] Enable SSL (forced by config or detected in URL)'); diff --git a/www/js/services/utils-services.js b/www/js/services/utils-services.js index d8a60d4c9285bf33e017254b4def453ddb8af487..56509fbfd842bcb4e8ddeea61aeed4e583e5908a 100644 --- a/www/js/services/utils-services.js +++ b/www/js/services/utils-services.js @@ -1,4 +1,4 @@ -angular.module('cesium.utils.services', ['ngResource']) +angular.module('cesium.utils.services', []) // Replace the '$ionicPlatform.ready()', to enable multiple calls // See http://stealthcode.co/multiple-calls-to-ionicplatform-ready/ diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index ff4a3f2c69e8fb47393526a3f5228c5a8851ce12..b9051f7a2ff486bf3fbf974a731ae674dda11d21 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -1,5 +1,5 @@ -angular.module('cesium.wallet.services', ['ngApi', 'cesium.bma.services', 'cesium.crypto.services', 'cesium.utils.services', +angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.services', 'cesium.crypto.services', 'cesium.utils.services', 'cesium.settings.services']) diff --git a/www/plugins/rml9/plugin-03-file_export.js b/www/plugins/rml9/plugin-03-file_export.js index a701642a72bb80c547d501f62e0e0971987720ad..d8c52a6a7352fb74dfe618e0e0574274796f99d0 100644 --- a/www/plugins/rml9/plugin-03-file_export.js +++ b/www/plugins/rml9/plugin-03-file_export.js @@ -1,5 +1,5 @@ -angular.module('cesium.rml9.plugin', ['cesium.services']) +angular.module('cesium.rml9.plugin', ['ngFileSaver', 'cesium.services']) .config(function($stateProvider, PluginServiceProvider, csConfig) { 'ngInject'; diff --git a/www/plugins/rml9/plugin-final.js b/www/plugins/rml9/plugin-final.js index 1efc71ae081ede469754f248a4c8cbc588c5e40e..dc79cc6b0f11c1c4c7e51e5c2d3a3a3e35754bff 100644 --- a/www/plugins/rml9/plugin-final.js +++ b/www/plugins/rml9/plugin-final.js @@ -1,5 +1,5 @@ -angular.module('cesium.rml9.plugin', ['cesium.services']) +angular.module('cesium.rml9.plugin', ['ngFileSaver', 'cesium.services']) .config(function($stateProvider, PluginServiceProvider, csConfig) { 'ngInject';