diff --git a/config.xml b/config.xml index d10778f692336f293f551a20f4b708049052f87e..a98bf4b67b718aec38a820c1eb319563c5aa60c1 100644 --- a/config.xml +++ b/config.xml @@ -8,10 +8,10 @@ > <name>Cesium</name> <description> - An simple App for Duniter + An simple App for Duniter </description> - <author email="contact@duniter.fr" href="http://www.duniter.fr"> - Duniter team + <author email="contact@e-is.pro"> + E-IS PRO </author> <content src="index.html" /> <access origin="*" /> @@ -88,7 +88,10 @@ <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> </platform> <platform name="firefoxos"> - <icon height="128" src="resources/firefoxos/img/logo_128.png" width="128" /> + <icon height="128" src="resources/firefoxos/img/logo_128px.png" width="128" /> <icon height="60" src="resources/firefoxos/img/logo_60.png" width="60" /> </platform> + <platform name="ubuntu"> + <icon height="57" src="resources/ubuntu/img/logo_57px.png" width="57"/> + </platform> </widget> diff --git a/resources/ubuntu/img/logo_57px.png b/resources/ubuntu/img/logo_57px.png new file mode 100644 index 0000000000000000000000000000000000000000..4adb392cbe5cf91b106c79dd1fd341fa2d0aeee7 Binary files /dev/null and b/resources/ubuntu/img/logo_57px.png differ diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 27bf18038ee7a945d00a62ba0fd93a60964efcd5..53c0f096e8f3de775deb93954e6a7afc03276366 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -326,7 +326,8 @@ "WAITING_MEMBERSHIP": "Membership request sent. Waiting validation.", "WAITING_CERTIFICATIONS": "You need {{needCertificationCount}} certification(s) to become a member", "WILL_MISSING_CERTIFICATIONS": "You will <b>lack certifications</b> soon (at least {{willNeedCertificationCount}} more are needed)", - "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renewing your membership</a> before then.", + "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renew your membership</a> before then.", + "NEED_RENEW_MEMBERSHIP": "You are no longer a member because your membership <b>has expired</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renew your membership</a>.", "CERTIFICATION_COUNT": "Received certifications", "CERTIFICATION_COUNT_SHORT": "Certifications", "SIG_STOCK": "Stock of certifications to give", diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index a9dcc92866dd6b887100e6373bf231d13e67640c..bf6b937216fdb2c5f67d0356ad2e82fb2f0f75c5 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -326,7 +326,8 @@ "WAITING_MEMBERSHIP": "Membership request sent. Waiting validation.", "WAITING_CERTIFICATIONS": "You need {{needCertificationCount}} certification(s) to become a member", "WILL_MISSING_CERTIFICATIONS": "You will <b>lack certifications</b> soon (at least {{willNeedCertificationCount}} more are needed)", - "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renewing your membership</a> before then.", + "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renew your membership</a> before then.", + "NEED_RENEW_MEMBERSHIP": "You are no longer a member because your membership <b>has expired</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renew your membership</a>.", "CERTIFICATION_COUNT": "Received certifications", "CERTIFICATION_COUNT_SHORT": "Certifications", "SIG_STOCK": "Stock of certifications to give", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index b492f1da8e9e86139c025f8d09cef29a77cff67a..3e54b3fcd3ea8378abab5f7812801dde3ec1aaaf 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -327,6 +327,7 @@ "WAITING_CERTIFICATIONS": "Vous devez obtenir {{needCertificationCount}} certification(s) pour devenir membre.", "WILL_MISSING_CERTIFICATIONS": "Vous allez bientôt <b>manquer de certification</b> (au moins {{willNeedCertificationCount}} est nécessaire)", "WILL_NEED_RENEW_MEMBERSHIP": "Votre adhésion comme membre <b>va expirer {{membershipExpiresIn|formatDurationTo}}</b>. Pensez à <a ng-click=\"doQuickFix('renew')\">renouveler votre adhésion</a> d'ici là.", + "NEED_RENEW_MEMBERSHIP": "Vous n'êtes plus membre, car votre adhésion <b>a expiré</b>. Pensez à <a ng-click=\"doQuickFix('renew')\">renouveler votre adhésion</a>.", "CERTIFICATION_COUNT": "Certifications reçues", "CERTIFICATION_COUNT_SHORT": "Certifications", "SIG_STOCK": "Certifications envoyées", diff --git a/www/img/logo_57px.png b/www/img/logo_57px.png new file mode 100644 index 0000000000000000000000000000000000000000..4adb392cbe5cf91b106c79dd1fd341fa2d0aeee7 Binary files /dev/null and b/www/img/logo_57px.png differ diff --git a/www/index.html b/www/index.html index b22e7854925ba6c54d5b351637f8df2ea685e867..18dad2743322a4dfe96a130f6b96e46b683191e7 100644 --- a/www/index.html +++ b/www/index.html @@ -6,6 +6,7 @@ <meta name="apple-mobile-web-app-capable" content="yes"> <title>Cesium</title> <link rel="icon" href="./img/favicon.ico"> + <link rel="apple-touch-icon" href="./img/logo_57px.png"> <link rel="manifest" href="/manifest.json"> <!-- build:css dist_css/cesium.css --> <link href="css/ionic.app.css" rel="stylesheet"> diff --git a/www/js/app.js b/www/js/app.js index 1bbfe69416500e8cdc90883a944e6f3ee6d0b934..2dbd8086f820169f4acb20c45f9b63411cc3806a 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -315,8 +315,10 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht $rootScope.rootPath = (hashIndex != -1) ? $window.location.href.substr(0, hashIndex) : $window.location.href; console.debug('[app] Detecting root path: ' + $rootScope.rootPath); - // removeIf(device) - // Automatic redirection to large state (if define) + // removeIf(android) + // removeIf(ios) + // removeIf(firefoxos) + // Automatic redirection to large state (if define) (keep this code for platforms web and ubuntu build) $rootScope.$on('$stateChangeStart', function (event, next, nextParams, fromState) { if (next.data.large && !UIUtils.screen.isSmall()) { var redirect = !$rootScope.tour && !event.currentScope.tour; // disabled for help tour @@ -326,7 +328,11 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht } } }); + // endRemoveIf(firefoxos) + // endRemoveIf(ios) + // endRemoveIf(android) + // removeIf(device) // Automatic redirection to HTTPS if ((csConfig.httpsMode === true || csConfig.httpsMode == 'true' ||csConfig.httpsMode === 'force') && $window.location.protocol != 'https:') { @@ -370,21 +376,21 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht .then(function() { // Keyboard - if (window.cordova && window.cordova.plugins.Keyboard) { + if (Device.keyboard.enable) { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) - cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); + Device.keyboard.hideKeyboardAccessoryBar(true); // iOS: do not push header up when opening keyboard // (see http://ionicframework.com/docs/api/page/keyboard/) if (ionic.Platform.isIOS()) { - cordova.plugins.Keyboard.disableScroll(true); + Device.keyboard.disableScroll(true); } } // Ionic Platform Grade is not A, disabling views transitions if (ionic.Platform.grade.toLowerCase()!='a') { - console.log('Disable UI effects - plateform\'s grade is not [a] but [' + ionic.Platform.grade + ']'); + console.log('[app] Disabling UI effects, because plateform\'s grade is [' + ionic.Platform.grade + ']'); UIUtils.setEffects(false); } diff --git a/www/js/config.js b/www/js/config.js index fc82d1666459f84016c2072b69a52a55a30435c1..d4a8108259824609ceb47ea4a7fa8cb28c73c75f 100644 --- a/www/js/config.js +++ b/www/js/config.js @@ -16,26 +16,24 @@ angular.module("cesium.config", []) "timeout": 10000, "timeWarningExpireMembership": 5184000, "timeWarningExpire": 7776000, - "useLocalStorage": false, + "useLocalStorage": true, "useRelative": false, - "initPhase": false, - "expertMode": false, - "decimalCount": 2, - "httpsMode": false, + "expertMode": true, + "decimalCount": 4, "helptip": { "enable": true, "installDocUrl": "https://github.com/duniter/duniter/blob/master/doc/install-a-node.md" }, "node": { - "host": "g1.duniter.org", - "port": "443" + "host": "gtest.duniter.org", + "port": 10900 }, "plugins": { "es": { "enable": true, "askEnable": false, - "host": "g1.data.duniter.fr", - "port": "443", + "host": "data.gtest.duniter.fr", + "port": 80, "notifications": { "txSent": true, "txReceived": true, @@ -45,7 +43,7 @@ angular.module("cesium.config", []) } }, "version": "0.11.6", - "build": "2017-03-14T16:13:13.246Z", + "build": "2017-03-15T07:26:50.512Z", "newIssueUrl": "https://github.com/duniter/cesium/issues/new?labels=bug" }) diff --git a/www/js/controllers/app-controllers.js b/www/js/controllers/app-controllers.js index 62866dbf1dc1d285bd64c43dfeea527055f48338..e2384e58181ba91c5cfea0135350cd557eb1a0d5 100644 --- a/www/js/controllers/app-controllers.js +++ b/www/js/controllers/app-controllers.js @@ -105,10 +105,10 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $ //////////////////////////////////////// $scope.scanQrCodeAndGo = function() { - if (!Device.enable) { + if (!Device.barcode.enable) { return; } - Device.camera.scan() + Device.barcode.scan() .then(function(uri) { if (!uri) { return; diff --git a/www/js/controllers/login-controllers.js b/www/js/controllers/login-controllers.js index 611796945b50ac66c2a25edfb4790977468d686b..27854b8d07bf5ac5d2d093cf3fdba396109562ae 100644 --- a/www/js/controllers/login-controllers.js +++ b/www/js/controllers/login-controllers.js @@ -27,9 +27,7 @@ function LoginModalController($scope, $timeout, CryptoUtils, UIUtils, Modals, cs return; } // removeIf(no-device) - if (window.cordova && cordova.plugins.Keyboard) { - cordova.plugins.Keyboard.close(); - } + Device.keyboard.close(); // endRemoveIf(no-device) UIUtils.loading.show(); diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index 5690ed8dffa0da6e0861fed71c24e2555009908a..194a710b7d00c253453c13ef4f13d1956a7cb891 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -382,10 +382,10 @@ function WotLookupController($scope, $state, $timeout, $focus, $ionicPopover, $i }; $scope.scanQrCode = function(){ - if (!Device.enable) { + if (!Device.barcode.enable) { return; } - Device.camera.scan() + Device.barcode.scan() .then(function(result) { if (!result) { return; diff --git a/www/js/services/device-services.js b/www/js/services/device-services.js index 6e2598e69f5a94c2ad3cac7a6708469ce5531c8e..573e1ecb9aa60858ed9ecc99cb25e18e144b3972 100644 --- a/www/js/services/device-services.js +++ b/www/js/services/device-services.js @@ -38,7 +38,7 @@ angular.module('cesium.device.services', ['ngResource', 'cesium.utils.services', // endRemoveIf(device) function getPicture(options) { - if (!exports.enable) { + if (!exports.camera.enable) { return $q.reject("Camera not enable. Please call 'Device.ready()' once before use (e.g in app.js)."); } @@ -133,19 +133,41 @@ angular.module('cesium.device.services', ['ngResource', 'cesium.utils.services', exports.clipboard = {copy: copy}; exports.camera = { getPicture : getPicture, - scan: scan + scan: function(n){ + console.log('Deprecated use of Device.camera.scan(). Use Device.barcode.scan() instead'); + return scan(n); + } }; + exports.barcode = { + enable : false, + scan: scan + }; + exports.keyboard = { + enable: false, + close: function() { + if (!exports.keyboard.enable) return; + cordova.plugins.Keyboard.close(); + } + }; var started = false; var startPromise = ionicReady().then(function(){ - var enableCamera = !!navigator.camera; - exports.enable = enableCamera; + exports.enable = cordova && cordova.plugins; + + console.info('TODO'); if (exports.enable){ - var enableBarcodeScanner = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner; + exports.camera.enable = !!navigator.camera; + exports.keyboard.enable = cordova && cordova.plugins && !!cordova.plugins.Keyboard; + exports.barcode.enable = cordova && cordova.plugins && !!cordova.plugins.barcodeScanner; + + if (exports.keyboard.enable) { + angular.extend(exports.keyboard, cordova.plugins.Keyboard); + } - console.debug('[device] Ionic platform ready, with [barcodescanner={0}] [camera={1}]'.format(enableBarcodeScanner, enableCamera)); + console.debug('[device] Ionic platform ready, with [camera: {0}] [barcode scanner: {1}] [keyboard: {2}]' + .format(exports.camera.enable, exports.barcode.enable, exports.keyboard.enable)); if (cordova.InAppBrowser) { console.debug('[device] Enabling InAppBrowser'); diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index 602aa1d31af433f37e826f0622a22e29c29a4f62..d4f4fd2f05420609a0b03963138fed7c2c68a55c 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -360,7 +360,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser // - same wallet uid // - is member // - has a pending membership - // - is not expired + // - is not expired (in sandbox) // - is not outdistanced // - if has certifications // max(count(certification) @@ -388,7 +388,8 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser idty.needSelf = false; idty.needMembership = (idty.membershipExpiresIn <= 0 && idty.membershipPendingExpiresIn <= 0 ); idty.needRenew = (!idty.needMembership && - idty.membershipExpiresIn <= csSettings.data.timeWarningExpireMembership && idty.membershipPendingExpiresIn <= 0); + idty.membershipExpiresIn <= csSettings.data.timeWarningExpireMembership && + idty.membershipPendingExpiresIn <= 0); idty.canMembershipOut = (idty.membershipExpiresIn > 0); idty.pendingMembership = (idty.membershipExpiresIn <= 0 && idty.membershipPendingExpiresIn > 0); idty.certificationCount = (idty.certifications) ? idty.certifications.length : 0; @@ -701,6 +702,9 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser if (data.requirements.needRenew) { addEvent({type:'warn', message: 'ACCOUNT.WILL_NEED_RENEW_MEMBERSHIP', messageParams: data.requirements, context: 'requirements'}); } + else if (data.requirements.wasMember && data.requirements.needMembership) { + addEvent({type:'warn', message: 'ACCOUNT.NEED_RENEW_MEMBERSHIP', messageParams: data.requirements, context: 'requirements'}); + } }, loadSigStock = function() { diff --git a/www/js/services/wot-services.js b/www/js/services/wot-services.js index c77edffff43452ab5656268c9d38c234c8f75fec..e408f6d913254610abcd6fb6b2350b43d60b4609 100644 --- a/www/js/services/wot-services.js +++ b/www/js/services/wot-services.js @@ -69,7 +69,7 @@ angular.module('cesium.wot.services', ['ngResource', 'ngApi', 'cesium.bma.servic // - same wallet uid // - is member // - has a pending membership - // - is not expired + // - is not expired (in sandbox) // - is not outdistanced // - if has certifications // max(count(certification) diff --git a/www/plugins/es/js/controllers/user-controllers.js b/www/plugins/es/js/controllers/user-controllers.js index ba76816c293db6696f2a198bae350d1aebec95f0..82280fc82c274fd1cdcd8b9190a84a2eb967a06c 100644 --- a/www/plugins/es/js/controllers/user-controllers.js +++ b/www/plugins/es/js/controllers/user-controllers.js @@ -241,7 +241,7 @@ function ProfileController($scope, $rootScope, $timeout, $state, $focus, $transl }; $scope.showAvatarModal = function() { - if (Device.enable) { + if (Device.camera.enable) { return Device.camera.getPicture() .then(function(imageData) { $scope.avatar = {src: "data:image/png;base64," + imageData}; diff --git a/www/plugins/es/templates/blockchain/items_blocks.html b/www/plugins/es/templates/blockchain/items_blocks.html index 7fceae1468865ae2222bb628eff74fc9bdd11ea8..8479ab0fd576f280ad4f1f80deaa6f934b3ee5eb 100644 --- a/www/plugins/es/templates/blockchain/items_blocks.html +++ b/www/plugins/es/templates/blockchain/items_blocks.html @@ -1,18 +1,5 @@ - -<div class="item row row-header done in hidden-xs hidden-sm" ng-if=":rebind:!expertMode"> - <!-- compact --> - <a class="button button-text button-small ink" - ng-class="{'button-text-positive': compactMode, 'button-text-stable': !compactMode}" - ng-click="toggleCompactMode()" > - <i class="icon ion-navicon"></i> - <b class="ion-arrow-down-b" style="position: absolute; top: -2px; left: 4px; font-size: 8px;"></b> - <b class="ion-arrow-up-b" style="position: absolute; top: 10px; left: 4px; font-size: 8px;"></b> - <span>{{'BLOCKCHAIN.LOOKUP.BTN_COMPACT'|translate}}</span> - </a> -</div> - -<div class="item row row-header done in hidden-xs hidden-sm" ng-if=":rebind:expertMode"> +<div class="item row row-header done in hidden-xs hidden-sm"> <!-- compact --> <a class="pull-left gray button button-text button-small no-margin no-padding" @@ -25,18 +12,22 @@ </a> <a class="no-padding dark col col-header" + ng-if=":rebind:expertMode" ng-click="toggleSort('medianTime')"> <cs-sort-icon asc="search.asc" sort="search.sort" toggle="'medianTime'"></cs-sort-icon> {{'BLOCKCHAIN.LOOKUP.HEADER_MEDIAN_TIME' | translate}} </a> <a class="no-padding dark col col-header" + ng-if=":rebind:expertMode" ng-click="toggleSort('issuer')"> <cs-sort-icon asc="search.asc" sort="search.sort" toggle="'issuer'"></cs-sort-icon> {{'BLOCKCHAIN.LOOKUP.HEADER_ISSUER' | translate}} </a> <div class="col col-20"> </div> - <a class="no-padding dark col col-20 col-header" ng-click="toggleSort('number')"> + <a class="no-padding dark col col-20 col-header" + ng-if=":rebind:expertMode" + ng-click="toggleSort('number')"> <cs-sort-icon asc="search.asc" sort="search.sort" toggle="'number'"></cs-sort-icon> {{'BLOCKCHAIN.LOOKUP.HEADER_BLOCK' | translate}} </a> diff --git a/www/templates/menu.html b/www/templates/menu.html index 22b8b1538f6d1de646f4b2c42806966dcaf45b21..39ef5fcaf19fc533445ba7d7a307560632841391 100644 --- a/www/templates/menu.html +++ b/www/templates/menu.html @@ -167,7 +167,7 @@ </ion-item> <!-- scan QR code --> - <ion-item menu-close class="item item-button-right" ng-if="$root.device.enable"> + <ion-item menu-close class="item item-button-right" ng-if="$root.device.barcode.enable"> <span translate>Scan</span> <button class="button button-stable ink" ng-click="scanQrCodeAndGo()"> <i class="icon ion-qr-scanner"></i> diff --git a/www/templates/wot/lookup.html b/www/templates/wot/lookup.html index 3e0b66e68100faced4f8356c3c469b78b0001db1..a4ffcfbd7ea9398dde2a939d609905ce0b67335e 100644 --- a/www/templates/wot/lookup.html +++ b/www/templates/wot/lookup.html @@ -5,6 +5,7 @@ <ion-nav-buttons side="secondary"> <button class="button button-icon button-clear icon ion-qr-scanner hidden-no-device" + ng-if="$root.device.barcode.enable" ng-click="scanQrCode()"> </button> <button class="button button-icon button-clear visible-xs visible-sm" diff --git a/www/templates/wot/modal_lookup.html b/www/templates/wot/modal_lookup.html index adfff54a05b6904698fff74ca37fb5bd3992c15b..4716864fd47624fc86c4c77bdf381c22b6ee85eb 100644 --- a/www/templates/wot/modal_lookup.html +++ b/www/templates/wot/modal_lookup.html @@ -20,7 +20,7 @@ <div class="visible-xs visible-sm text-right stable-bg stable"> <button class="button button-icon button-small-padding dark hidden-no-device ink" - ng-if="::$root.device.enable" + ng-if="$root.device.barcode.enable" ng-click="scanQrCode()"> <i class="icon ion-qr-scanner"></i> </button>