diff --git a/app-template/copay/appConfig.json b/app-template/copay/appConfig.json index 60afe4b6b..4bc581559 100644 --- a/app-template/copay/appConfig.json +++ b/app-template/copay/appConfig.json @@ -5,6 +5,8 @@ "nameCase": "Copay", "nameCaseNoSpace": "Copay", "bundleName": "copay", + "gitHubRepoName": "copay", + "disclaimerUrl": "https://copay.io/disclaimer", "url": "https://copay.io", "appDescription": "Copay Bitcoin Wallet", "winAppName": "CopayWallet", @@ -18,5 +20,5 @@ "coinbase": true, "glidera": true, "amazon": true - } + } } diff --git a/public/views/modals/addressbook.html b/public/views/modals/addressbook.html index 77b43b5ef..e6a434a8c 100644 --- a/public/views/modals/addressbook.html +++ b/public/views/modals/addressbook.html @@ -1,13 +1,13 @@ -
Addressbook Add entry
- -
Changing wallet alias only affects the local wallet name.
+
Changing wallet alias only affects the local wallet name.
diff --git a/public/views/preferencesBwsUrl.html b/public/views/preferencesBwsUrl.html index 71542f87f..4cb483b88 100644 --- a/public/views/preferencesBwsUrl.html +++ b/public/views/preferencesBwsUrl.html @@ -6,17 +6,15 @@ -
-
- -
-
- -
+
+
- + diff --git a/public/views/preferencesDeleteWallet.html b/public/views/preferencesDeleteWallet.html index c68b8e984..0cc6f099b 100644 --- a/public/views/preferencesDeleteWallet.html +++ b/public/views/preferencesDeleteWallet.html @@ -4,12 +4,14 @@ - -
Warning!
-
Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED
-
- {{alias}}{{walletName}} + +
+

Warning!

+
Permanently delete this wallet. THIS ACTION CANNOT BE REVERSED
+
+ {{alias}}{{walletName}} +
- +
diff --git a/public/views/preferencesEmail.html b/public/views/preferencesEmail.html index 2ac020111..d7a81e90e 100644 --- a/public/views/preferencesEmail.html +++ b/public/views/preferencesEmail.html @@ -6,13 +6,19 @@
- - +
+ +
+
-
Setting up email notifications could weaken your privacy, if the wallet service provider is compromised. Information available to an attacker would include your wallet addresses and its balance, but no more. +
Setting up email notifications could weaken your privacy, if the wallet service provider is compromised. Information available to an attacker would include your wallet addresses and its balance, but no more.
diff --git a/public/views/preferencesFee.html b/public/views/preferencesFee.html index 89c2d417e..fb178fbf8 100644 --- a/public/views/preferencesFee.html +++ b/public/views/preferencesFee.html @@ -6,19 +6,17 @@ -
- Loading... -
- {{feeOpts[fee.level]|translate}} + + {{feeOpts[fee.level]|translate}} -
-
- Average confirmation time: {{fee.nbBlocks * 10}} minutes. -
- Current fee rate for this policy: {{fee.feePerKBUnit}}/kiB -
-
- Bitcoin transactions may include a fee collected by miners on the network. The higher the fee, the greater the incentive a miner has to include that transaction in a block. Current fees are determined based on network load and the selected policy. +
+
+ Average confirmation time: {{fee.nbBlocks * 10}} minutes.
+ Current fee rate for this policy: {{fee.feePerKBUnit}}/kiB +
+
+ Bitcoin transactions may include a fee collected by miners on the network. The higher the fee, the greater the incentive a miner has to include that transaction in a block. Current fees are determined based on network load and the selected policy. +
diff --git a/public/views/preferencesHistory.html b/public/views/preferencesHistory.html index 001ab547a..e2d2d8d55 100644 --- a/public/views/preferencesHistory.html +++ b/public/views/preferencesHistory.html @@ -6,7 +6,7 @@
-
+
Export to file
@@ -15,7 +15,7 @@ preparing...
-
+
Clear cache
diff --git a/public/views/preferencesInformation.html b/public/views/preferencesInformation.html index e527bdf63..2fe6298ce 100644 --- a/public/views/preferencesInformation.html +++ b/public/views/preferencesInformation.html @@ -6,9 +6,7 @@
-
- Wallet Information -
+
Wallet Name (at creation) @@ -64,23 +62,23 @@
-
+
Copayers
-
- {{copayer.name}} ({{'Me'|translate}}) - {{copayer.name}} - +
+ {{copayer.name}} + + ({{'Me'|translate}}) +
-
+
Extended Public Keys
- Copayer {{$index}}< - + Copayer {{$index}} Copayer {{$index}} {{pk}} @@ -89,27 +87,27 @@
-
+
Last Wallet Addresses
- {{a.address}} - {{a.path}} · {{a.createdOn *1000 | amDateFormat:'MMMM Do YYYY, h:mm a' }} - + {{a.address}} + {{a.path}} · {{a.createdOn *1000 | amDateFormat:'MMMM Do YYYY, h:mm a' }}
-
+
Only Main (not change) addresses are shown. The addresses on this list were not verified locally at this time.
+ Scan addresses for funds + + Send addresses by email + +
-
-
+
+
Balance By Address
diff --git a/public/views/preferencesLanguage.html b/public/views/preferencesLanguage.html index 3adb8a34a..df04e0160 100644 --- a/public/views/preferencesLanguage.html +++ b/public/views/preferencesLanguage.html @@ -8,10 +8,12 @@ {{lang.name}} - All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at - https://crowdin.com/project/copay. - - Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language. - +
+ All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at + https://crowdin.com/project/copay. + + Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language. + +
diff --git a/public/views/preferencesLogs.html b/public/views/preferencesLogs.html index dcd0add3e..8d2d1311b 100644 --- a/public/views/preferencesLogs.html +++ b/public/views/preferencesLogs.html @@ -4,16 +4,25 @@ - - + -
    -
  • - - {{l.msg}} - -
  • -
diff --git a/public/views/tab-settings.html b/public/views/tab-settings.html index d0f99acc0..1b8220bb6 100644 --- a/public/views/tab-settings.html +++ b/public/views/tab-settings.html @@ -6,7 +6,6 @@
-
Address Book @@ -14,36 +13,40 @@
Preferences
-
+
Language {{currentLanguageName|translate}} +
-
+
Unit {{unitName}} +
-
+
Alternative Currency {{selectedAlternative.name}} +
-
- +
+ Bitcoin Network Fee Policy {{feeOpts[currentFeeLevel]|translate}} +
@@ -80,8 +83,8 @@ Use Unconfirmed Funds -
Wallets Settings
-
Wallets Preferences
+
@@ -92,14 +95,15 @@ Incomplete +
-
- - About Bitpay Wallet +
+ + About {{appName}} +
-
diff --git a/public/views/termsOfUse.html b/public/views/termsOfUse.html index 788b1b4b0..7fd05725a 100644 --- a/public/views/termsOfUse.html +++ b/public/views/termsOfUse.html @@ -5,14 +5,14 @@ - -

-

-

- + +
+
+
+
diff --git a/public/views/translators.html b/public/views/translators.html index 7163e1e45..cb865e3eb 100644 --- a/public/views/translators.html +++ b/public/views/translators.html @@ -5,29 +5,29 @@ - -

Translation Credits

-
    -
  • kinoshitajonaJapanese
  • -
  • KirvxFrench
  • -
  • saschadGerman
  • -
  • cmgustavo83Spanish
  • -
  • RussianNeuroMancerRussian
  • -
  • HostFatItalian
  • -
  • xm2hiChinese
  • -
  • Pirx1618Polish
  • -
  • mareksipCzech
  • -
-
-
-

- All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at - https://crowdin.com/project/copay. -

- - Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language. - -
+ +
+
+ Translation Credits
+
kinoshitajonaJapanese
+
KirvxFrench
+
saschadGerman
+
cmgustavo83Spanish
+
RussianNeuroMancerRussian
+
HostFatItalian
+
xm2hiChinese
+
Pirx1618Polish
+
mareksipCzech
+
+
+

+ All contributions to Copay's translation are welcome. Sign up at crowdin.com and join the Copay project at + https://crowdin.com/project/copay. +

+ + Don't see your language on Crowdin? Contact the Owner on Crowdin! We'd love to support your language. + +
diff --git a/public/views/walletDetails.html b/public/views/walletDetails.html index 6e586caee..78cd5ce10 100644 --- a/public/views/walletDetails.html +++ b/public/views/walletDetails.html @@ -94,7 +94,7 @@
-
+
{{newRelease}}
diff --git a/src/js/controllers/amazon.js b/src/js/controllers/amazon.js index 353c73600..302bd2a24 100644 --- a/src/js/controllers/amazon.js +++ b/src/js/controllers/amazon.js @@ -1,15 +1,10 @@ 'use strict'; angular.module('copayApp.controllers').controller('amazonController', - function($scope, $timeout, $ionicModal, $log, lodash, bwcError, amazonService, platformInfo, nodeWebkit, popupService) { + function($scope, $timeout, $ionicModal, $log, lodash, bwcError, amazonService, platformInfo, externalLinkService, popupService) { $scope.openExternalLink = function(url, target) { - if (platformInfo.isNW) { - nodeWebkit.openExternalLink(url); - } else { - target = target || '_blank'; - var ref = window.open(url, target, 'location=no'); - } + externalLinkService.open(url, target); }; this.init = function() { diff --git a/src/js/controllers/buyAmazon.js b/src/js/controllers/buyAmazon.js index 61409d6ef..b0b2d948d 100644 --- a/src/js/controllers/buyAmazon.js +++ b/src/js/controllers/buyAmazon.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('buyAmazonController', - function($scope, $log, $timeout, $state, lodash, profileService, bwcError, gettextCatalog, configService, walletService, amazonService, ongoingProcess, platformInfo, nodeWebkit, popupService) { + function($scope, $log, $timeout, $state, lodash, profileService, bwcError, gettextCatalog, configService, walletService, amazonService, ongoingProcess, platformInfo, externalLinkService, popupService) { var self = this; var wallet; @@ -16,12 +16,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController', }); $scope.openExternalLink = function(url, target) { - if (platformInfo.isNW) { - nodeWebkit.openExternalLink(url); - } else { - target = target || '_blank'; - var ref = window.open(url, target, 'location=no'); - } + externalLinkService.open(url, target); }; this.init = function() { diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js index 8eaac6558..e1703411a 100644 --- a/src/js/controllers/glidera.js +++ b/src/js/controllers/glidera.js @@ -1,15 +1,10 @@ 'use strict'; angular.module('copayApp.controllers').controller('glideraController', - function($scope, $timeout, $ionicModal, $log, storageService, glideraService, ongoingProcess, platformInfo, nodeWebkit, popupService, gettextCatalog) { + function($scope, $timeout, $ionicModal, $log, storageService, glideraService, ongoingProcess, platformInfo, externalLinkService, popupService, gettextCatalog) { $scope.openExternalLink = function(url, target) { - if (platformInfo.isNW) { - nodeWebkit.openExternalLink(url); - } else { - target = target || '_blank'; - var ref = window.open(url, target, 'location=no'); - } + externalLinkService.open(url, target); }; $scope.init = function(accessToken) { diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index 2db8bb8b1..3de9cda31 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $scope, $filter, $stateParams, $ionicPopup, gettextCatalog, profileService, configService, lodash, txFormatService, platformInfo) { +angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $scope, $filter, $stateParams, $ionicPopup, gettextCatalog, profileService, configService, lodash, txFormatService, platformInfo, externalLinkService) { var self = $scope.self; var wallet = profileService.getWallet($stateParams.walletId); @@ -81,12 +81,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio }; $scope.openExternalLink = function(url, target) { - if (platformInfo.isNW) { - nodeWebkit.openExternalLink(url); - } else { - target = target || '_blank'; - var ref = window.open(url, target, 'location=no'); - } + externalLinkService.open(url, target); }; $scope.getShortNetworkName = function() { diff --git a/src/js/controllers/onboarding/terms.js b/src/js/controllers/onboarding/terms.js index e3f30c321..a76d52b96 100644 --- a/src/js/controllers/onboarding/terms.js +++ b/src/js/controllers/onboarding/terms.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, uxLanguage, profileService) { +angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, uxLanguage, profileService, externalLinkService) { $scope.lang = uxLanguage.currentLanguage; $scope.confirm = function() { @@ -12,4 +12,8 @@ angular.module('copayApp.controllers').controller('termsController', function($s }); }; + $scope.openExternalLink = function(url, target) { + externalLinkService.open(url, target); + }; + }); diff --git a/src/js/controllers/preferences.js b/src/js/controllers/preferences.js index f66aad999..288ef49f4 100644 --- a/src/js/controllers/preferences.js +++ b/src/js/controllers/preferences.js @@ -2,7 +2,7 @@ angular.module('copayApp.controllers').controller('preferencesController', function($scope, $rootScope, $timeout, $log, $stateParams, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, profileService, fingerprintService, walletService) { - $ionicNavBarDelegate.title(gettextCatalog.getString('Preferences')); + $ionicNavBarDelegate.title(gettextCatalog.getString('Wallet Preferences')); var wallet = profileService.getWallet($stateParams.walletId); var walletId = wallet.credentials.walletId; $scope.wallet = wallet; @@ -14,9 +14,6 @@ angular.module('copayApp.controllers').controller('preferencesController', return $ionicHistory.goBack(); var config = configService.getSync(); - config.aliasFor = config.aliasFor || {}; - $scope.alias = config.aliasFor[walletId] || wallet.credentials.walletName; - $scope.color = config.colorFor[walletId] || '#4A90E2'; $scope.encryptEnabled = walletService.isEncrypted(wallet); if (wallet.isPrivKeyExternal) diff --git a/src/js/controllers/preferencesAbout.js b/src/js/controllers/preferencesAbout.js index 002c399b4..55ae224d9 100644 --- a/src/js/controllers/preferencesAbout.js +++ b/src/js/controllers/preferencesAbout.js @@ -1,9 +1,14 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesAbout', - function($scope, $window, $ionicNavBarDelegate, gettextCatalog) { - $ionicNavBarDelegate.title(gettextCatalog.getString('About Copay')); + function($scope, $window, $ionicNavBarDelegate, gettextCatalog, externalLinkService) { + $ionicNavBarDelegate.title(gettextCatalog.getString('About') + ' ' + $window.appConfig.nameCase); $scope.version = $window.version; $scope.commitHash = $window.commitHash; + $scope.name = $window.appConfig.gitHubRepoName; + + $scope.openExternalLink = function(url, target) { + externalLinkService.open(url, target); + }; }); diff --git a/src/js/controllers/preferencesAlias.js b/src/js/controllers/preferencesAlias.js index 41557fa80..d51957301 100644 --- a/src/js/controllers/preferencesAlias.js +++ b/src/js/controllers/preferencesAlias.js @@ -8,9 +8,8 @@ angular.module('copayApp.controllers').controller('preferencesAliasController', var walletId = wallet.credentials.walletId; var config = configService.getSync(); - config.aliasFor = config.aliasFor || {}; $scope.walletName = wallet.credentials.walletName; - $scope.alias = config.aliasFor[walletId] || wallet.walletName; + $scope.alias = (config.aliasFor && config.aliasFor[walletId]) || wallet.walletName; $scope.save = function() { var opts = { diff --git a/src/js/controllers/preferencesDelete.js b/src/js/controllers/preferencesDelete.js index 19cdccb1e..8e95a31c1 100644 --- a/src/js/controllers/preferencesDelete.js +++ b/src/js/controllers/preferencesDelete.js @@ -1,32 +1,17 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesDeleteWalletController', - function($scope, $ionicPopup, $stateParams, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) { - $ionicNavBarDelegate.title(gettextCatalog.getString('Delete Wallet')); + function($scope, $stateParams, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, lodash, profileService, $state, ongoingProcess, popupService) { + $ionicNavBarDelegate.title(gettextCatalog.getString('Delete')); var wallet = profileService.getWallet($stateParams.walletId); $scope.alias = lodash.isEqual(wallet.name, wallet.credentials.walletName) ? null : wallet.name + ' '; $scope.walletName = '[' + wallet.credentials.walletName + ']'; $scope.showDeletePopup = function() { - var popup = $ionicPopup.show({ - template: '' + gettextCatalog.getString('Are you sure you want to delete this wallet?') + '', - title: gettextCatalog.getString('Confirm'), - buttons: [ - { - text: gettextCatalog.getString('Cancel'), - onTap: function(e) { - popup.close(); - } - }, - { - text: gettextCatalog.getString('Accept'), - type: 'button-positive', - onTap: function(e) { - deleteWallet(); - popup.close(); - } - } - ] + var title = gettextCatalog.getString('Warning!'); + var message = gettextCatalog.getString('Are you sure you want to delete this wallet?'); + popupService.showConfirm(title, message, function(res) { + if (res) deleteWallet(); }); }; diff --git a/src/js/controllers/preferencesFee.js b/src/js/controllers/preferencesFee.js index e254f0411..4fa0c0761 100644 --- a/src/js/controllers/preferencesFee.js +++ b/src/js/controllers/preferencesFee.js @@ -1,12 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, feeService) { - $ionicNavBarDelegate.title(gettextCatalog.getString('Preferences fee')); +angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, $timeout, $ionicHistory, $ionicNavBarDelegate, gettextCatalog, configService, feeService, ongoingProcess) { + $ionicNavBarDelegate.title(gettextCatalog.getString('Bitcoin Network Fee Policy')); $scope.init = function() { - $scope.loading = true; + ongoingProcess.set('gettingFeeLevels', true); feeService.getFeeLevels(function(levels) { - $scope.loading = false; + ongoingProcess.set('gettingFeeLevels', false); $scope.feeOpts = feeService.feeOpts; $scope.currentFeeLevel = feeService.getCurrentFeeLevel(); $scope.feeLevels = levels; @@ -29,7 +29,7 @@ angular.module('copayApp.controllers').controller('preferencesFeeController', fu $ionicHistory.goBack(); $timeout(function() { $scope.$apply(); - }, 10); + }, 100); }); }; }); diff --git a/src/js/controllers/preferencesHistory.js b/src/js/controllers/preferencesHistory.js index b0c6d45e9..a44f69b36 100644 --- a/src/js/controllers/preferencesHistory.js +++ b/src/js/controllers/preferencesHistory.js @@ -3,15 +3,14 @@ angular.module('copayApp.controllers').controller('preferencesHistory', function($scope, $log, $stateParams, $timeout, $ionicNavBarDelegate, gettextCatalog, storageService, $state, $ionicHistory, profileService, lodash) { $ionicNavBarDelegate.title(gettextCatalog.getString('Transaction History')); - var wallet = profileService.getWallet($stateParams.walletId); - var c = wallet.credentials; + $scope.wallet = profileService.getWallet($stateParams.walletId); $scope.csvReady = false; $scope.csvHistory = function(cb) { var allTxs = []; function getHistory(cb) { - storageService.getTxHistory(c.walletId, function(err, txs) { + storageService.getTxHistory($scope.wallet.id, function(err, txs) { if (err) return cb(err); var txsFromLocal = []; @@ -40,7 +39,7 @@ angular.module('copayApp.controllers').controller('preferencesHistory', var data = txs; var satToBtc = 1 / 100000000; $scope.csvContent = []; - $scope.csvFilename = 'Copay-' + ($scope.alias || $scope.walletName) + '.csv'; + $scope.csvFilename = 'Copay-' + $scope.wallet.name + '.csv'; $scope.csvHeader = ['Date', 'Destination', 'Description', 'Amount', 'Currency', 'Txid', 'Creator', 'Copayers', 'Comment']; var _amount, _note, _copayers, _creator, _comment; @@ -118,7 +117,7 @@ angular.module('copayApp.controllers').controller('preferencesHistory', }; $scope.clearTransactionHistory = function() { - storageService.removeTxHistory(c.walletId, function(err) { + storageService.removeTxHistory($scope.wallet.id, function(err) { if (err) { $log.error(err); return; diff --git a/src/js/controllers/preferencesLanguage.js b/src/js/controllers/preferencesLanguage.js index 8327e84a5..5ae3b2588 100644 --- a/src/js/controllers/preferencesLanguage.js +++ b/src/js/controllers/preferencesLanguage.js @@ -1,9 +1,13 @@ 'use strict'; angular.module('copayApp.controllers').controller('preferencesLanguageController', - function($scope, $log, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, configService, profileService, uxLanguage, walletService) { + function($scope, $log, $ionicNavBarDelegate, $ionicHistory, gettextCatalog, configService, profileService, uxLanguage, walletService, externalLinkService) { $ionicNavBarDelegate.title(gettextCatalog.getString('Language')); + $scope.openExternalLink = function(url, target) { + externalLinkService.open(url, target); + }; + $scope.init = function() { $scope.availableLanguages = uxLanguage.getLanguages(); $scope.currentLanguage = uxLanguage.getCurrentLanguage(); diff --git a/src/js/controllers/preferencesLogs.js b/src/js/controllers/preferencesLogs.js index 153a279aa..6c9a8c16d 100644 --- a/src/js/controllers/preferencesLogs.js +++ b/src/js/controllers/preferencesLogs.js @@ -8,13 +8,19 @@ angular.module('copayApp.controllers').controller('preferencesLogs', $scope.logs = historicLog.get(); } - $scope.sendLogs = function() { - var body = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n'; - body += '\n\n'; - body += $scope.logs.map(function(v) { + $scope.prepare = function() { + var log = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n'; + log += '\n\n'; + log += $scope.logs.map(function(v) { return v.msg; }).join('\n'); + return log; + }; + + $scope.sendLogs = function() { + var body = $scope.prepare(); + window.plugins.socialsharing.shareViaEmail( body, 'Copay Logs', diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index ca45e1411..e4ce0e833 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $rootScope, $log, $ionicModal, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { +angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $rootScope, $log, $ionicModal, $window, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService) { $scope.init = function() { @@ -9,6 +9,8 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct var isWP = platformInfo.isWP; var isIOS = platformInfo.isIOS; + $scope.appName = $window.appConfig.nameCase; + $scope.unitName = config.wallet.settings.unitName; $scope.currentLanguageName = uxLanguage.getCurrentLanguageName(); $scope.selectedAlternative = { diff --git a/src/js/controllers/termOfUse.js b/src/js/controllers/termOfUse.js index c66f55b8c..7632e187a 100644 --- a/src/js/controllers/termOfUse.js +++ b/src/js/controllers/termOfUse.js @@ -1,7 +1,12 @@ 'use strict'; angular.module('copayApp.controllers').controller('termOfUseController', - function($scope, uxLanguage, $ionicNavBarDelegate, gettextCatalog) { - $ionicNavBarDelegate.title(gettextCatalog.getString('About Copay')); + function($scope, $window, uxLanguage, $ionicNavBarDelegate, gettextCatalog, externalLinkService) { + $ionicNavBarDelegate.title(gettextCatalog.getString('Terms Of Use')); $scope.lang = uxLanguage.currentLanguage; + $scope.disclaimerUrl = $window.appConfig.disclaimerUrl; + + $scope.openExternalLink = function(url, target) { + externalLinkService.open(url, target); + }; }); diff --git a/src/js/controllers/translators.js b/src/js/controllers/translators.js new file mode 100644 index 000000000..7f09f58d5 --- /dev/null +++ b/src/js/controllers/translators.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('translatorsController', + function($scope, externalLinkService) { + $scope.openExternalLink = function(url, target) { + externalLinkService.open(url, target); + }; + }); diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 349e57bf2..6e8f7b078 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, $ionicPopup, txpModalService) { +angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService, $ionicPopup, txpModalService, externalLinkService) { var isCordova = platformInfo.isCordova; var isWP = platformInfo.isWP; @@ -12,6 +12,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun var HISTORY_SHOW_LIMIT = 10; $scope.txps = []; + $scope.openExternalLink = function(url, target) { + externalLinkService.open(url, target); + }; var setPendingTxps = function(txps) { if (!txps) { diff --git a/src/js/directives/copyToClipboard.js b/src/js/directives/copyToClipboard.js index 1e9cbfe92..b6523b6f1 100644 --- a/src/js/directives/copyToClipboard.js +++ b/src/js/directives/copyToClipboard.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.directives') - .directive('copyToClipboard', function(platformInfo, nodeWebkit, gettextCatalog, ionicToast, clipboard) { + .directive('copyToClipboard', function(platformInfo, nodeWebkitService, gettextCatalog, ionicToast, clipboard) { return { restrict: 'A', scope: { @@ -22,7 +22,7 @@ angular.module('copayApp.directives') window.cordova.plugins.clipboard.copy(data); window.plugins.toast.showShortCenter(msg); } else if (isNW) { - nodeWebkit.writeToClipboard(data); + nodeWebkitService.writeToClipboard(data); scope.$apply(function() { ionicToast.show(msg, 'bottom', false, 1000); }); diff --git a/src/js/services/externalLinkService.js b/src/js/services/externalLinkService.js new file mode 100644 index 000000000..aa1951fd6 --- /dev/null +++ b/src/js/services/externalLinkService.js @@ -0,0 +1,14 @@ +'use strict'; + +angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService) { + + this.open = function(url, target) { + if (platformInfo.isNW) { + nodeWebkitService.openExternalLink(url); + } else { + target = target || '_blank'; + var ref = window.open(url, target, 'location=no'); + } + }; + +}); diff --git a/src/js/services/nodeWebkit.js b/src/js/services/nodeWebkit.js deleted file mode 100644 index c1e13d84b..000000000 --- a/src/js/services/nodeWebkit.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -angular.module('copayApp.services').factory('nodeWebkit', function nodeWebkitFactory() { - var root = {}; - - var isNodeWebkit = function() { - var isNode = (typeof process !== "undefined" && typeof require !== "undefined"); - if(isNode) { - try { - return (typeof require('nw.gui') !== "undefined"); - } catch(e) { - return false; - } - } - }; - - root.readFromClipboard = function() { - if (!isNodeWebkit()) return; - var gui = require('nw.gui'); - var clipboard = gui.Clipboard.get(); - return clipboard.get(); - }; - - root.writeToClipboard = function(text) { - if (!isNodeWebkit()) return; - var gui = require('nw.gui'); - var clipboard = gui.Clipboard.get(); - return clipboard.set(text); - }; - - root.openExternalLink = function(url) { - if (!isNodeWebkit()) return; - var gui = require('nw.gui'); - return gui.Shell.openExternal(url); - }; - - return root; -}); diff --git a/src/js/services/nodeWebkitService.js b/src/js/services/nodeWebkitService.js new file mode 100644 index 000000000..a2b836ca5 --- /dev/null +++ b/src/js/services/nodeWebkitService.js @@ -0,0 +1,22 @@ +'use strict'; + +angular.module('copayApp.services').service('nodeWebkitService', function() { + + this.readFromClipboard = function() { + var gui = require('nw.gui'); + var clipboard = gui.Clipboard.get(); + return clipboard.get(); + }; + + this.writeToClipboard = function(text) { + var gui = require('nw.gui'); + var clipboard = gui.Clipboard.get(); + return clipboard.set(text); + }; + + this.openExternalLink = function(url) { + var gui = require('nw.gui'); + return gui.Shell.openExternal(url); + }; + +}); diff --git a/src/js/services/onGoingProcess.js b/src/js/services/onGoingProcess.js index 2c433a4af..8f6b3c014 100644 --- a/src/js/services/onGoingProcess.js +++ b/src/js/services/onGoingProcess.js @@ -31,6 +31,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti 'sweepingWallet': gettext('Sweeping Wallet...'), 'deletingWallet': gettext('Deleting Wallet...'), 'extractingWalletInfo': gettext('Extracting Wallet Information...'), + 'gettingFeeLevels': gettext('Getting fee levels...'), }; root.clear = function() { diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 9a3ae09fa..4bd0612b0 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -31,9 +31,9 @@ angular.module('copayApp.services') root.updateWalletSettings = function(wallet) { var defaults = configService.getDefaults(); configService.whenAvailable(function(config){ - wallet.usingCustomBWS = config.bwsFor[wallet.id] && (config.bwsFor[wallet.id] != defaults.bws.url); - wallet.name = config.aliasFor[wallet.id] || wallet.credentials.walletName; - wallet.color = config.colorFor[wallet.id] || '#4A90E2'; + wallet.usingCustomBWS = config.bwsFor && config.bwsFor[wallet.id] && (config.bwsFor[wallet.id] != defaults.bws.url); + wallet.name = (config.aliasFor && config.aliasFor[wallet.id]) || wallet.credentials.walletName; + wallet.color = (config.colorFor && config.colorFor[wallet.id]) || '#4A90E2'; wallet.email = config.emailFor && config.emailFor[wallet.id]; }); }