diff --git a/public/views/backup.html b/public/views/backup.html index 52aa511f5..b3afff887 100644 --- a/public/views/backup.html +++ b/public/views/backup.html @@ -8,7 +8,7 @@
-
+
In order to restore your Copay wallet you will need these 12 backup words. @@ -17,37 +17,53 @@
+
+
+ The backup words had been deleted from this device +
+
-
-
- - - Show Backup Words - Hide Backup Words - - +
+ + +
+ + {{word}} + +
+
+ + Once you have wrote your backup words, it is recommended to delete them from this device. + +
+ +
+
+
+
+ You can safely install your backup on another device and use your wallet from multiple devices at the same time. + Learn more about Copay backups +
+
+
-
- - {{word}} - -
-
- - Once you have wrote your backup words, it is recommended to delete them from Copay. - -
- -
-
-
- - -
diff --git a/public/views/export.html b/public/views/export.html index 5a62268ac..2196c87f8 100644 --- a/public/views/export.html +++ b/public/views/export.html @@ -1,7 +1,7 @@
+ ng-init="titleSection='Export'; goBackToState = 'preferencesAdvanced'">
@@ -35,16 +35,7 @@
- -
+
-
-
- * You can safely install your backup on another device and use your wallet from multiple devices at the same time. -
-
-
diff --git a/public/views/preferences.html b/public/views/preferences.html index ea68b7fee..005df5bd5 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -57,10 +57,11 @@

 

-
  • +
  • Export
  • +
  • Advanced diff --git a/public/views/preferencesAdvanced.html b/public/views/preferencesAdvanced.html index 7f1684cda..da39f5c3d 100644 --- a/public/views/preferencesAdvanced.html +++ b/public/views/preferencesAdvanced.html @@ -16,6 +16,11 @@
  • Scan addresses for funds
  • + +
  • + + Export +
  • diff --git a/src/js/controllers/backup.js b/src/js/controllers/backup.js index a2a502021..56f71c58f 100644 --- a/src/js/controllers/backup.js +++ b/src/js/controllers/backup.js @@ -1,7 +1,11 @@ 'use strict'; angular.module('copayApp.controllers').controller('wordsController', - function($rootScope, $scope, $timeout, profileService, go, gettext) { + function($rootScope, $scope, $timeout, profileService, go, gettext, confirmDialog, notification) { + + var msg = gettext('Are you to delete the backup words?'); + var successMsg = gettext('Backup words deleted'); + this.getMnemonic = function() { var fc = profileService.focusedClient; var words = fc.getMnemonic(); @@ -12,4 +16,19 @@ angular.module('copayApp.controllers').controller('wordsController', this.done = function() { $rootScope.$emit('Local/BackupDone'); }; + + this.delete = function() { + var fc = profileService.focusedClient; + confirmDialog.show(msg,function(ok){ + if (ok) { + fc.clearMnemonic(); + profileService.updateCredentialsFC(function() { + notification.success(successMsg); + go.walletHome(); + }); + } + }); + }; + + this.mywords = this.getMnemonic(); }); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 9dfcd0efc..68796383d 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -773,7 +773,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r $timeout(function() { $rootScope.$apply(); }); - }; self.recreate = function(cb) { diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 4bc7599b6..fb59383c6 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, feeService, bwsError, utilService) { +angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, feeService, bwsError, confirmDialog, utilService) { var self = this; $rootScope.hideMenuBar = false; @@ -1138,6 +1138,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi this.setForm(null, amount, null, feeRate); }; + // TODO: showPopup alike this.confirmDialog = function(msg, cb) { if (isCordova) { navigator.notification.confirm( diff --git a/src/js/routes.js b/src/js/routes.js index e309bec55..97879ae17 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -577,6 +577,7 @@ angular preferencesBwsUrl: 12, preferencesAlias: 12, preferencesEmail: 12, + export: 13, logs: 13, information: 13, translators: 13, diff --git a/src/js/services/confirmDialog.js b/src/js/services/confirmDialog.js new file mode 100644 index 000000000..47d3ca358 --- /dev/null +++ b/src/js/services/confirmDialog.js @@ -0,0 +1,37 @@ + +'use strict'; + +angular.module('copayApp.services').factory('confirmDialog', function($log, profileService, configService, gettextCatalog, isCordova, isChromeApp) { + var root = {}; + + + var acceptMsg = gettextCatalog.getString('Accept'); + var cancelMsg = gettextCatalog.getString('Cancel'); + var confirmMsg = gettextCatalog.getString('Confirm'); + + root.show = function(msg, cb) { + if (isCordova) { + navigator.notification.confirm( + msg, + function(buttonIndex) { + if (buttonIndex == 1) { + $timeout(function() { + return cb(true); + }, 1); + } else { + return cb(false); + } + }, + confirmMsg, [acceptMsg, cancelMsg] + ); + } else if (isChromeApp) { + // No feedback, alert/confirm not supported. + return cb(true); + } else { + return cb(confirm(msg)); + } + }; + + return root; +}); + diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index d3dcf88ba..c4ef8f997 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -174,14 +174,8 @@ angular.module('copayApp.services') var walletClient = bwcService.getClient(); // TODO LANG... // TODO... +log.warn("TODO LANG!") walletClient.seedFromRandomWithMnemonic('livenet'); -console.log('[profileService.js.200:walletClient:]',walletClient); //TODO - -console.log('[profileService.js.180]'); //TODO -console.log('[profileService.js.180]'); //TODO -console.log('[profileService.js.180]'); //TODO -console.log('[profileService.js.180]'); //TODO -console.log('[profileService.js.180]'); //TODO walletClient.createWallet('Personal Wallet', 'me', 1, 1, { network: 'livenet' @@ -213,8 +207,8 @@ console.log('[profileService.js.180]'); //TODO } // TODO LANG... // TODO... +log.warn("TODO LANG!") walletClient.seedFromRandomWithMnemonic(opts.networkName); -console.log('[profileService.js.200:walletClient:]',walletClient); //TODO walletClient.createWallet(opts.name, opts.myName || 'me', opts.m, opts.n, { network: opts.networkName