From 5696a68029dc25ec48899aeaea8830ca596afc4e Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 25 Jun 2018 17:13:56 +0200 Subject: [PATCH 01/44] Send mail instead of the Send Feedback screen. --- src/js/controllers/tab-settings.js | 12 ++++++++++++ www/views/tab-settings.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index 6cfc80def..7106aa743 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -45,6 +45,18 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct }); }; + $scope.sendFeedback = function() { + var mailToLink = 'mailto:wallet@bitcoin.com?subject=Feedback%20for%20Bitcoin.com%20Wallet.com'; + if (platformInfo.isNW) { + nw.Shell.openExternal(mailToLink); + } else if (platformInfo.isCordova) { + var mailWindow = window.open(mailToLink, '_system'); + mailWindow.close(); // XX SP: bugfix for some browsers in cordova to change the view entirely + } else { + window.location.href = mailToLink; + } + }; + $scope.openExternalLink = function() { var appName = appConfigService.name; var url = appName == 'copay' ? 'https://github.com/bitcoin-com/wallet/issues' : 'https://www.bitcoin.com/wallet-support'; diff --git a/www/views/tab-settings.html b/www/views/tab-settings.html index 1105937d4..fefaf2fc2 100644 --- a/www/views/tab-settings.html +++ b/www/views/tab-settings.html @@ -22,7 +22,7 @@ - + From e8f2f2d188cc5668a648a73d31ac41e29c4aa729 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 25 Jun 2018 17:15:06 +0200 Subject: [PATCH 02/44] removed the route of the feedback form --- src/js/routes.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index 4e72246ba..82987d1ac 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -795,22 +795,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr fromOnboarding: null }, }) - - /* - * - * Feedback - * - */ - - .state('tabs.feedback', { - url: '/feedback', - views: { - 'tab-settings@tabs': { - templateUrl: 'views/feedback/send.html', - controller: 'sendController' - } - } - }) .state('tabs.shareApp', { url: '/shareApp/:score/:skipped/:fromSettings', views: { From 9396c7c97faef4e2b64c88b4d4f19effc191f951 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 27 Jun 2018 16:43:09 +0200 Subject: [PATCH 03/44] Removed all references to the rating card & feedback --- src/js/controllers/feedback/rateApp.js | 53 --------- src/js/controllers/feedback/rateCard.js | 60 ----------- src/js/controllers/feedback/send.js | 102 ------------------ .../{feedback/complete.js => shareApp.js} | 33 +----- src/js/controllers/tab-home.js | 40 +------ src/js/routes.js | 38 +------ src/js/services/feedbackService.js | 59 ---------- src/js/services/storageService.js | 8 -- src/sass/views/feedback/rateApp.scss | 38 ------- src/sass/views/feedback/rateCard.scss | 18 ---- src/sass/views/feedback/send.scss | 54 ---------- .../{feedback/complete.scss => shareApp.scss} | 15 +-- src/sass/views/views.scss | 5 +- www/views/feedback/rateApp.html | 21 ---- www/views/feedback/rateCard.html | 43 -------- www/views/feedback/send.html | 48 --------- .../{feedback/complete.html => shareApp.html} | 30 ++---- www/views/tab-home.html | 2 - www/views/tab-settings.html | 2 +- 19 files changed, 17 insertions(+), 652 deletions(-) delete mode 100644 src/js/controllers/feedback/rateApp.js delete mode 100644 src/js/controllers/feedback/rateCard.js delete mode 100644 src/js/controllers/feedback/send.js rename src/js/controllers/{feedback/complete.js => shareApp.js} (77%) delete mode 100644 src/js/services/feedbackService.js delete mode 100644 src/sass/views/feedback/rateApp.scss delete mode 100644 src/sass/views/feedback/rateCard.scss delete mode 100644 src/sass/views/feedback/send.scss rename src/sass/views/{feedback/complete.scss => shareApp.scss} (86%) delete mode 100644 www/views/feedback/rateApp.html delete mode 100644 www/views/feedback/rateCard.html delete mode 100644 www/views/feedback/send.html rename www/views/{feedback/complete.html => shareApp.html} (55%) diff --git a/src/js/controllers/feedback/rateApp.js b/src/js/controllers/feedback/rateApp.js deleted file mode 100644 index 6ae485a3a..000000000 --- a/src/js/controllers/feedback/rateApp.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('rateAppController', function($scope, $state, $stateParams, $window, lodash, externalLinkService, configService, platformInfo, feedbackService, ongoingProcess, popupService, appConfigService) { - $scope.score = parseInt($stateParams.score); - $scope.appName = appConfigService.nameCase; - var isAndroid = platformInfo.isAndroid; - var isIOS = platformInfo.isIOS; - - var config = configService.getSync(); - - $scope.skip = function() { - var dataSrc = { - "Email": lodash.values(config.emailFor)[0] || ' ', - "Feedback": ' ', - "Score": $stateParams.score, - "AppVersion": $window.version, - "Platform": ionic.Platform.platform(), - "DeviceVersion": ionic.Platform.version() - }; - feedbackService.send(dataSrc, function(err) { - if (err) { - // try to send, but not essential, since the user didn't add a message - $log.warn('Could not send feedback.'); - } - }); - $state.go('tabs.rate.complete', { - score: $stateParams.score, - skipped: true - }); - }; - - $scope.sendFeedback = function() { - $state.go('tabs.rate.send', { - score: $scope.score - }); - }; - - $scope.goAppStore = function() { - var defaults = configService.getDefaults(); - var url; - if (isAndroid) - url = defaults.rateApp.bitcoincom.android; - if (isIOS) - url = defaults.rateApp.bitcoincom.ios; - - externalLinkService.open(url); - $state.go('tabs.rate.complete', { - score: $stateParams.score, - skipped: true, - rated: true - }); - }; -}); diff --git a/src/js/controllers/feedback/rateCard.js b/src/js/controllers/feedback/rateCard.js deleted file mode 100644 index abc109796..000000000 --- a/src/js/controllers/feedback/rateCard.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('rateCardController', function($scope, $state, $timeout, $log, gettextCatalog, platformInfo, storageService, appConfigService) { - - $scope.isCordova = platformInfo.isCordova; - $scope.score = 0; - $scope.appName = appConfigService.nameCase; - - $scope.goFeedbackFlow = function() { - $scope.hideCard(); - if ($scope.isCordova && $scope.score == 5) { - $state.go('tabs.rate.rateApp', { - score: $scope.score - }); - } else { - $state.go('tabs.rate.send', { - score: $scope.score - }); - } - }; - - $scope.setScore = function(score) { - $scope.score = score; - switch ($scope.score) { - case 1: - $scope.button_title = gettextCatalog.getString("I think this app is terrible."); - break; - case 2: - $scope.button_title = gettextCatalog.getString("I don't like it"); - break; - case 3: - $scope.button_title = gettextCatalog.getString("Meh - it's alright"); - break; - case 4: - $scope.button_title = gettextCatalog.getString("I like the app"); - break; - case 5: - $scope.button_title = gettextCatalog.getString("This app is fantastic!"); - break; - } - $timeout(function() { - $scope.$apply(); - }); - }; - - $scope.hideCard = function() { - $log.debug('Feedback card dismissed.') - storageService.getFeedbackInfo(function(error, info) { - var feedbackInfo = JSON.parse(info); - feedbackInfo.sent = true; - storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() { - $scope.showRateCard.value = false; - $timeout(function() { - $scope.$apply(); - }, 100); - }); - }); - } - -}); diff --git a/src/js/controllers/feedback/send.js b/src/js/controllers/feedback/send.js deleted file mode 100644 index 23fb0ea59..000000000 --- a/src/js/controllers/feedback/send.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, $ionicConfig, $window, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess, platformInfo, appConfigService) { - - $scope.sendFeedback = function(feedback, goHome) { - - var config = configService.getSync(); - - var dataSrc = { - "Email": lodash.values(config.emailFor)[0] || ' ', - "Feedback": goHome ? ' ' : feedback, - "Score": $stateParams.score || ' ', - "AppVersion": $window.version, - "Platform": ionic.Platform.platform(), - "DeviceVersion": ionic.Platform.version() - }; - - if (!goHome) ongoingProcess.set('sendingFeedback', true); - feedbackService.send(dataSrc, function(err) { - if (goHome) return; - ongoingProcess.set('sendingFeedback', false); - if (err) { - popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Feedback could not be submitted. Please try again later.')); - return; - } - if (!$stateParams.score) { - popupService.showAlert(gettextCatalog.getString('Thank you!'), gettextCatalog.getString('A member of the team will review your feedback as soon as possible.'), function() { - $scope.feedback.value = ''; - $ionicHistory.nextViewOptions({ - disableAnimate: false, - historyRoot: true - }); - $ionicHistory.goBack(); - }, gettextCatalog.getString('Finish')); - return; - } - $state.go('tabs.rate.complete', { - score: $stateParams.score - }); - }); - if (goHome) $state.go('tabs.home'); - }; - - $scope.$on("$ionicView.beforeLeave", function(event, data) { - $ionicConfig.views.swipeBackEnabled(true); - }); - - $scope.$on("$ionicView.enter", function(event, data) { - if ($scope.score) - $ionicConfig.views.swipeBackEnabled(false); - }); - - $scope.$on("$ionicView.beforeEnter", function(event, data) { - $scope.isCordova = platformInfo.isCordova; - $scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null; - $scope.feedback = {}; - - switch ($scope.score) { - case 1: - $scope.reaction = "Ouch!"; - $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong.") + ' ' + gettextCatalog.getString("How could we improve your experience?"); - break; - case 2: - $scope.reaction = gettextCatalog.getString("Oh no!"); - $scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong.") + ' ' + gettextCatalog.getString("How could we improve your experience?"); - break; - case 3: - $scope.reaction = "Hmm..."; - $scope.comment = gettextCatalog.getString("We'd love to do better.") + ' ' + gettextCatalog.getString("How could we improve your experience?"); - break; - case 4: - $scope.reaction = gettextCatalog.getString("Thanks!"); - $scope.comment = gettextCatalog.getString("That's exciting to hear. We'd love to earn that fifth star from you – how could we improve your experience?"); - break; - case 5: - $scope.reaction = gettextCatalog.getString("Thank you!"); - $scope.comment = gettextCatalog.getString("We're always looking for ways to improve {{appName}}.", { - appName: appConfigService.nameCase - }) + ' ' + gettextCatalog.getString("Is there anything we could do better?"); - break; - default: - $scope.justFeedback = true; - $scope.comment = gettextCatalog.getString("We're always looking for ways to improve {{appName}}. How could we improve your experience?", { - appName: appConfigService.nameCase - }); - break; - } - }); - - $scope.$on("$ionicView.afterEnter", function() { - $scope.showForm = true; - }); - - $scope.goBack = function() { - $ionicHistory.nextViewOptions({ - disableAnimate: false, - historyRoot: true - }); - $ionicHistory.goBack(); - }; - -}); diff --git a/src/js/controllers/feedback/complete.js b/src/js/controllers/shareApp.js similarity index 77% rename from src/js/controllers/feedback/complete.js rename to src/js/controllers/shareApp.js index 905880901..ba3fdedff 100644 --- a/src/js/controllers/feedback/complete.js +++ b/src/js/controllers/shareApp.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, $ionicNavBarDelegate, $ionicConfig, platformInfo, configService, storageService, lodash, appConfigService, gettextCatalog) { +angular.module('copayApp.controllers').controller('shareAppController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, $ionicNavBarDelegate, $ionicConfig, platformInfo, configService, storageService, lodash, appConfigService, gettextCatalog) { $scope.isCordova = platformInfo.isCordova; $scope.title = gettextCatalog.getString("Share {{appName}}", { appName: appConfigService.nameCase @@ -57,28 +57,8 @@ angular.module('copayApp.controllers').controller('completeController', function $ionicConfig.views.swipeBackEnabled(true); }); - $scope.$on("$ionicView.enter", function() { - if (!$scope.fromSettings) - $ionicConfig.views.swipeBackEnabled(false); - }); - $scope.$on("$ionicView.beforeEnter", function(event, data) { - $scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null; - $scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false; - $scope.rated = (data.stateParams && data.stateParams.rated) ? true : false; - $scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false; - - if (!$scope.fromSettings) { - $ionicNavBarDelegate.showBackButton(false); - } else { - $ionicNavBarDelegate.showBackButton(true); - } - - storageService.getFeedbackInfo(function(error, info) { - var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null; - feedbackInfo.sent = true; - storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {}); - }); + $ionicNavBarDelegate.showBackButton(true); if (!$scope.isCordova) return; $scope.animate = true; @@ -133,13 +113,4 @@ angular.module('copayApp.controllers').controller('completeController', function } }, 100); }); - - $scope.close = function() { - $ionicHistory.nextViewOptions({ - disableAnimate: false, - historyRoot: true - }); - if ($scope.score == 5) $ionicHistory.goBack(-3); - else $ionicHistory.goBack(-2); - }; }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 1332287b6..56ce3279f 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) { + function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) { var wallet; var listeners = []; var notifications = []; @@ -14,7 +14,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.isAndroid = platformInfo.isAndroid; $scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP; $scope.isNW = platformInfo.isNW; - $scope.showRateCard = {}; $scope.showServices = false; $scope.$on("$ionicView.afterEnter", function() { @@ -42,43 +41,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', } }); } - - storageService.getFeedbackInfo(function(error, info) { - - if ($scope.isWindowsPhoneApp) { - $scope.showRateCard.value = false; - return; - } - if (!info) { - initFeedBackInfo(); - } else { - var feedbackInfo = JSON.parse(info); - //Check if current version is greater than saved version - var currentVersion = $scope.version; - var savedVersion = feedbackInfo.version; - var isVersionUpdated = feedbackService.isVersionUpdated(currentVersion, savedVersion); - if (!isVersionUpdated) { - initFeedBackInfo(); - return; - } - var now = moment().unix(); - var timeExceeded = (now - feedbackInfo.time) >= 24 * 7 * 60 * 60; - $scope.showRateCard.value = timeExceeded && !feedbackInfo.sent; - $timeout(function() { - $scope.$apply(); - }); - } - }); - - function initFeedBackInfo() { - var feedbackInfo = {}; - feedbackInfo.time = moment().unix(); - feedbackInfo.version = $scope.version; - feedbackInfo.sent = false; - storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() { - $scope.showRateCard.value = false; - }); - }; }); $scope.$on("$ionicView.enter", function(event, data) { diff --git a/src/js/routes.js b/src/js/routes.js index 82987d1ac..63f92ef8f 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -796,46 +796,14 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }, }) .state('tabs.shareApp', { - url: '/shareApp/:score/:skipped/:fromSettings', + url: '/shareApp', views: { 'tab-settings@tabs': { - controller: 'completeController', - templateUrl: 'views/feedback/complete.html' + controller: 'shareAppController', + templateUrl: 'views/shareApp.html' } } }) - .state('tabs.rate', { - url: '/rate', - abstract: true - }) - .state('tabs.rate.send', { - url: '/send/:score', - views: { - 'tab-home@tabs': { - templateUrl: 'views/feedback/send.html', - controller: 'sendController' - } - } - }) - .state('tabs.rate.complete', { - url: '/complete/:score/:skipped', - views: { - 'tab-home@tabs': { - controller: 'completeController', - templateUrl: 'views/feedback/complete.html' - } - } - }) - .state('tabs.rate.rateApp', { - url: '/rateApp/:score', - views: { - 'tab-home@tabs': { - controller: 'rateAppController', - templateUrl: 'views/feedback/rateApp.html' - } - } - }) - /* * * Buy or Sell Bitcoin diff --git a/src/js/services/feedbackService.js b/src/js/services/feedbackService.js deleted file mode 100644 index ae4711d27..000000000 --- a/src/js/services/feedbackService.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -angular.module('copayApp.services').factory('feedbackService', function($http, $log, $httpParamSerializer, configService) { - var root = {}; -// var URL = "https://script.google.com/macros/s/1pWGRxVSUX9CxPqNAKZTppWHtDvyVtZv9HteY_TRQbWc/exec"; - var URL = "https://wallet-data.bitcoin.com/feedback.php"; - - root.send = function(dataSrc, cb) { - $http(_post(dataSrc)).then(function() { - $log.info("SUCCESS: Feedback sent"); - return cb(); - }, function(err) { - $log.info("ERROR: Feedback sent anyway."); - return cb(err); - }); - }; - - var _post = function(dataSrc) { - return { - method: 'POST', - url: URL, - headers: { - 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' - }, - data: $httpParamSerializer(dataSrc) - }; - }; - - root.isVersionUpdated = function(currentVersion, savedVersion) { - - if (!verifyTagFormat(currentVersion)) - return 'Cannot verify the format of version tag: ' + currentVersion; - if (!verifyTagFormat(savedVersion)) - return 'Cannot verify the format of the saved version tag: ' + savedVersion; - - var current = formatTagNumber(currentVersion); - var saved = formatTagNumber(savedVersion); - if (saved.major > current.major || (saved.major == current.major && saved.minor > current.minor)) - return false; - - return true; - - function verifyTagFormat(tag) { - var regex = /^v?\d+\.\d+\.\d+$/i; - return regex.exec(tag); - }; - - function formatTagNumber(tag) { - var formattedNumber = tag.replace(/^v/i, '').split('.'); - return { - major: +formattedNumber[0], - minor: +formattedNumber[1], - patch: +formattedNumber[2] - }; - }; - - }; - - return root; -}); diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index a2d85950b..154391e55 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -250,14 +250,6 @@ angular.module('copayApp.services') }); }; - root.setFeedbackInfo = function(feedbackValues, cb) { - storage.set('feedback', feedbackValues, cb); - }; - - root.getFeedbackInfo = function(cb) { - storage.get('feedback', cb); - }; - root.storeFocusedWalletId = function(id, cb) { storage.set('focusedWalletId', id || '', cb); }; diff --git a/src/sass/views/feedback/rateApp.scss b/src/sass/views/feedback/rateApp.scss deleted file mode 100644 index 8a4cd2b8e..000000000 --- a/src/sass/views/feedback/rateApp.scss +++ /dev/null @@ -1,38 +0,0 @@ -#rate-app { - background-color: #ffffff; - text-align: center; - .skip-rating { - color: $v-dark-gray; - position: absolute; - top: 5px; - right: 10px; - padding: 15px; - } - .icon-svg > img { - width: 80px; - height: 80px; - margin-top: 15px; - } - .feedback-title { - font-size: 20px; - font-weight: bold; - color: $v-dark-gray; - margin: 80px 50px 10px; - text-align: center; - } - .share-the-love-illustration { - width: 5rem; - margin: 1rem; - } - .subtitle { - padding: 10px 30px 20px 40px; - color: $v-mid-gray; - } - .rate-buttons { - bottom: 0; - width: 100%; - position: absolute; - background-color: $v-subtle-gray; - padding: 30px 0 15px; - } -} diff --git a/src/sass/views/feedback/rateCard.scss b/src/sass/views/feedback/rateCard.scss deleted file mode 100644 index 9d57643d6..000000000 --- a/src/sass/views/feedback/rateCard.scss +++ /dev/null @@ -1,18 +0,0 @@ -#rate-card { - .item-heading { - font-weight: 700; - } - .row { - border: none; - } - .item-icon-right { - margin: 0; - } - .feedback-flow-button { - margin-bottom: 20px; - } - .icon-svg > img { - height: 1.8rem; - margin-bottom: 5px; - } -} diff --git a/src/sass/views/feedback/send.scss b/src/sass/views/feedback/send.scss deleted file mode 100644 index 807c4f8c5..000000000 --- a/src/sass/views/feedback/send.scss +++ /dev/null @@ -1,54 +0,0 @@ -#send-feedback { - @extend .deflash-blue; - background-color: #ffffff; - .row { - border: none; - } - .skip { - color: rgba(255, 255, 255, 0.3); - } - .feedback-heading { - padding-top: 20px - } - .feedback-title { - padding-left: 10px; - font-size: 20px; - font-weight: bold; - color: $v-dark-gray; - } - .rating { - text-align: right; - padding-right: 15px; - } - .comment { - padding: 0 20px 20px; - font-size: 1rem; - line-height: 1.5em; - font-weight: 300; - color: $v-dark-gray; - } - .user-feedback { - border-top: 1px solid $v-subtle-gray; - border-bottom: 1px solid $v-subtle-gray; - padding: 20px; - width: 100%; - margin-bottom: 20px; - -webkit-appearance: none; - } - .send-feedback-star { - height: 1rem; - margin-left: 5px; - } - .form-fade-in { - opacity: 0; - animation-name: fadeIn; - animation-duration: .5s; - animation-fill-mode: forwards; - animation-timing-function: ease-in; - } -} - -@keyframes fadeIn { - from { opacity: 0; } - to { opacity: 1; } -} diff --git a/src/sass/views/feedback/complete.scss b/src/sass/views/shareApp.scss similarity index 86% rename from src/sass/views/feedback/complete.scss rename to src/sass/views/shareApp.scss index bb2e75ea6..9a0ed0698 100644 --- a/src/sass/views/feedback/complete.scss +++ b/src/sass/views/shareApp.scss @@ -1,6 +1,6 @@ -#complete { +#share-app { background-color: #fff; - .complete-layout { + .share-app-layout { display: flex; flex-direction: column; height: 100%; @@ -22,17 +22,6 @@ width: 5rem; margin: 1rem; } - .send-feedback-illustration { - height: 16rem; - margin: 1rem; - } - .feedback-title { - font-size: 20px; - font-weight: bold; - color: $v-dark-gray; - margin: 20px 10px; - text-align: center; - } .subtitle { padding: 10px 30px 20px; text-align: center; diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 37754970f..d4ed735ed 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -22,10 +22,7 @@ @import "wallet-backup-phrase"; @import "zero-state"; @import "onboarding/onboarding"; -@import "feedback/rateCard"; -@import "feedback/send"; -@import "feedback/complete"; -@import "feedback/rateApp"; +@import "shareApp"; @import "includes/actionSheet"; @import "export"; @import "import"; diff --git a/www/views/feedback/rateApp.html b/www/views/feedback/rateApp.html deleted file mode 100644 index 9913b9d4e..000000000 --- a/www/views/feedback/rateApp.html +++ /dev/null @@ -1,21 +0,0 @@ - - - Not now -
Thank you!
- -
- 5-star ratings help us get {{appName}} into more hands, and more users means more resources can be committed to the app! -
-
- Would you be willing to rate {{appName}} in the app store? -
-
- - -
- - diff --git a/www/views/feedback/rateCard.html b/www/views/feedback/rateCard.html deleted file mode 100644 index d31199466..000000000 --- a/www/views/feedback/rateCard.html +++ /dev/null @@ -1,43 +0,0 @@ -
-
- How do you like {{appName}}? - -
-
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- -
diff --git a/www/views/feedback/send.html b/www/views/feedback/send.html deleted file mode 100644 index bb979bdee..000000000 --- a/www/views/feedback/send.html +++ /dev/null @@ -1,48 +0,0 @@ - - - {{'Send Feedback' | translate}} - - - - - - - - - - -
- {{comment}} -
-
- - -
-
-
diff --git a/www/views/feedback/complete.html b/www/views/shareApp.html similarity index 55% rename from www/views/feedback/complete.html rename to www/views/shareApp.html index 03a98a476..f148e81a0 100644 --- a/www/views/feedback/complete.html +++ b/www/views/shareApp.html @@ -1,32 +1,16 @@ - + {{title}} - - - -
-
-
- -
Share the love by inviting your friends.
-
-
- -
A member of the team will review your feedback as soon as possible.
-
-
If you have additional feedback, please let us know by tapping the "Send feedback" option in the Settings tab.
- -
-
Share the love by inviting your friends.
-
+ -
-
diff --git a/www/views/tab-settings.html b/www/views/tab-settings.html index fefaf2fc2..3091e63a6 100644 --- a/www/views/tab-settings.html +++ b/www/views/tab-settings.html @@ -29,7 +29,7 @@ {{'Send Feedback' | translate}} - + From 1ee95cf26268346d0ea59f166ca799a72fbe3707 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Mon, 9 Jul 2018 18:22:11 +0200 Subject: [PATCH 04/44] new send-tab --- src/js/controllers/tab-send-v2.js | 301 +++++++++++++++++++++++++ src/js/directives/gravatar.js | 17 +- src/js/routes.js | 9 + src/js/services/clipboardService.js | 20 ++ src/sass/buttons.scss | 23 ++ src/sass/views/address-book.scss | 1 - src/sass/views/tab-send-v2.scss | 228 +++++++++++++++++++ src/sass/views/views.scss | 1 + www/img/contact-placeholder.svg | 30 ++- www/img/icon-clipboard-paste-white.svg | 25 ++ www/img/icon-clipboard-paste.svg | 25 ++ www/img/icon-contact-add.svg | 10 + www/img/icon-scan-qr.svg | 63 ++++++ www/img/icon-w2w.svg | 26 +++ www/views/tab-send-v2.html | 143 ++++++++++++ www/views/tabs.html | 2 +- 16 files changed, 907 insertions(+), 17 deletions(-) create mode 100644 src/js/controllers/tab-send-v2.js create mode 100644 src/sass/views/tab-send-v2.scss create mode 100644 www/img/icon-clipboard-paste-white.svg create mode 100644 www/img/icon-clipboard-paste.svg create mode 100644 www/img/icon-contact-add.svg create mode 100644 www/img/icon-scan-qr.svg create mode 100644 www/img/icon-w2w.svg create mode 100644 www/views/tab-send-v2.html diff --git a/src/js/controllers/tab-send-v2.js b/src/js/controllers/tab-send-v2.js new file mode 100644 index 000000000..624acb5bb --- /dev/null +++ b/src/js/controllers/tab-send-v2.js @@ -0,0 +1,301 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { + var clipboardHasAddress = false; + + $scope.addContact = function() { + $state.go('tabs.settings').then(function() { + $state.go('tabs.addressbook').then(function() { + $state.go('tabs.addressbook.add'); + }); + }); + }; + + $scope.pasteClipboard = function() { + clipboardService.readFromClipboard(function(text) { + $scope.formData.search = text; + $scope.findContact($scope.formData.search); + }); + } + + $scope.$on("$ionicView.enter", function(event, data) { + clipboardService.readFromClipboard(function(text) { + $scope.clipboardHasAddress = false; + if ((text.indexOf('bitcoincash:') === 0 || text[0] === 'C' || text[0] === 'H' || text[0] === 'p' || text[0] === 'q') && text.replace('bitcoincash:', '').length === 42) { // CashAddr + $scope.clipboardHasAddress = true; + } else if ((text[0] === "1" || text[0] === "3" || text.substring(0, 3) === "bc1") && text.length >= 26 && text.length <= 35) { // Legacy Addresses + $scope.clipboardHasAddress = true; + } + }); + + $ionicNavBarDelegate.showBar(true); + if (!$scope.hasWallets) { + $scope.checkingBalance = false; + return; + } + updateHasFunds(); + updateWalletsList(); + updateContactsList(function() { + updateList(); + }); + }); + + + + + + + + + + + + + + + + + var originalList; + var CONTACTS_SHOW_LIMIT; + var currentContactsPage; + + $scope.sectionDisplay = { + transferToWallet: false + }; + + var hasWallets = function() { + $scope.wallets = profileService.getWallets({ + onlyComplete: true + }); + $scope.hasWallets = lodash.isEmpty($scope.wallets) ? false : true; + }; + + // THIS is ONLY to show the 'buy bitcoins' message + // does not has any other function. + + var updateHasFunds = function() { + + if ($rootScope.everHasFunds) { + $scope.hasFunds = true; + return; + } + + $scope.hasFunds = false; + var index = 0; + lodash.each($scope.wallets, function(w) { + walletService.getStatus(w, {}, function(err, status) { + + ++index; + if (err && !status) { + $log.error(err); + // error updating the wallet. Probably a network error, do not show + // the 'buy bitcoins' message. + + $scope.hasFunds = true; + } else if (status.availableBalanceSat > 0) { + $scope.hasFunds = true; + $rootScope.everHasFunds = true; + } + + if (index == $scope.wallets.length) { + $scope.checkingBalance = false; + $timeout(function() { + $scope.$apply(); + }); + } + }); + }); + }; + + var updateWalletsList = function() { + var config = configService.getSync(); + var networkResult = lodash.countBy($scope.wallets, 'network'); + + $scope.showTransferCard = $scope.hasWallets && (networkResult.livenet > 1 || networkResult.testnet > 1); + + if ($scope.showTransferCard) { + var walletsToTransfer = $scope.wallets; + if (!(networkResult.livenet > 1)) { + walletsToTransfer = lodash.filter(walletsToTransfer, function(item) { + return item.network == 'testnet'; + }); + } + if (!(networkResult.testnet > 1)) { + walletsToTransfer = lodash.filter(walletsToTransfer, function(item) { + return item.network == 'livenet'; + }); + } + + var walletList = []; + lodash.each(walletsToTransfer, function(v) { + var displayBalanceAsFiat = + // BD got v.status as undefined here once during development, just + // after creating a new wallet. + v.status && + v.status.alternativeBalanceAvailable && + config.wallet.settings.priceDisplay === 'fiat'; + + walletList.push({ + color: v.color, + name: v.name, + recipientType: 'wallet', + coin: v.coin, + network: v.network, + balanceString: displayBalanceAsFiat ? + v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode : + v.cachedBalance, + getAddress: function(cb) { + walletService.getAddress(v, false, cb); + }, + }); + }); + originalList = originalList.concat(walletList); + } + } + + var updateContactsList = function(cb) { + var config = configService.getSync(); + var defaults = configService.getDefaults(); + addressbookService.list(function(err, ab) { + if (err) $log.error(err); + + $scope.hasContacts = lodash.isEmpty(ab) ? false : true; + if (!$scope.hasContacts) return cb(); + + var completeContacts = []; + lodash.each(ab, function(v, k) { + completeContacts.push({ + name: lodash.isObject(v) ? v.name : v, + address: k, + email: lodash.isObject(v) ? v.email : null, + recipientType: 'contact', + coin: v.coin, + displayCoin: (v.coin == 'bch' + ? (config.bitcoinCashAlias || defaults.bitcoinCashAlias) + : (config.bitcoinAlias || defaults.bitcoinAlias)).toUpperCase(), + getAddress: function(cb) { + return cb(null, k); + }, + }); + }); + var contacts = completeContacts.slice(0, (currentContactsPage + 1) * CONTACTS_SHOW_LIMIT); + $scope.contactsShowMore = completeContacts.length > contacts.length; + originalList = originalList.concat(contacts); + return cb(); + }); + }; + + var updateList = function() { + $scope.list = lodash.clone(originalList); + $timeout(function() { + $ionicScrollDelegate.resize(); + $scope.$apply(); + }, 10); + }; + + $scope.openScanner = function() { + var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP; + + if (!isWindowsPhoneApp) { + $state.go('tabs.scan'); + return; + } + + scannerService.useOldScanner(function(err, contents) { + if (err) { + popupService.showAlert(gettextCatalog.getString('Error'), err); + return; + } + incomingData.redir(contents); + }); + }; + + $scope.showMore = function() { + currentContactsPage++; + updateWalletsList(); + }; + + $scope.searchInFocus = function() { + $scope.searchFocus = true; + }; + + $scope.searchBlurred = function() { + if ($scope.formData.search == null || $scope.formData.search.length == 0) { + $scope.searchFocus = false; + } + }; + + $scope.findContact = function(search) { + + if (incomingData.redir(search)) { + return; + } + + if (!search || search.length < 2) { + $scope.list = originalList; + $timeout(function() { + $scope.$apply(); + }); + return; + } + + var result = lodash.filter(originalList, function(item) { + var val = item.name; + return lodash.includes(val.toLowerCase(), search.toLowerCase()); + }); + + $scope.list = result; + }; + + $scope.goToAmount = function(item) { + $timeout(function() { + item.getAddress(function(err, addr) { + if (err || !addr) { + //Error is already formated + return popupService.showAlert(err); + } + + if (item.recipientType && item.recipientType == 'contact') { + if (addr.indexOf('bch') == 0 || addr.indexOf('btc') == 0) { + addr = addr.substring(3); + } + } + + $log.debug('Got toAddress:' + addr + ' | ' + item.name); + return $state.transitionTo('tabs.send.amount', { + recipientType: item.recipientType, + displayAddress: item.coin == 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, + toAddress: addr, + toName: item.name, + toEmail: item.email, + toColor: item.color, + coin: item.coin + }); + }); + }); + }; + + // This could probably be enhanced refactoring the routes abstract states + $scope.createWallet = function() { + $state.go('tabs.home').then(function() { + $state.go('tabs.add.create-personal'); + }); + }; + + $scope.buyBitcoin = function() { + $state.go('tabs.home').then(function() { + $state.go('tabs.buyandsell'); + }); + }; + + $scope.$on("$ionicView.beforeEnter", function(event, data) { + $scope.checkingBalance = true; + $scope.formData = { + search: null + }; + originalList = []; + CONTACTS_SHOW_LIMIT = 10; + currentContactsPage = 0; + hasWallets(); + }); +}); diff --git a/src/js/directives/gravatar.js b/src/js/directives/gravatar.js index 5f7931798..c96a63cfe 100644 --- a/src/js/directives/gravatar.js +++ b/src/js/directives/gravatar.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.directives') - .directive('gravatar', function(md5) { + .directive('gravatar', function(md5, $http) { return { restrict: 'AE', replace: true, @@ -9,13 +9,24 @@ angular.module('copayApp.directives') name: '@', height: '@', width: '@', - email: '@' + email: '@', + url: '@' }, link: function(scope, el, attr) { if (typeof scope.email === "string") { scope.emailHash = md5.createHash(scope.email.toLowerCase() || ''); + var req = { + method: 'GET', + url: 'https://secure.gravatar.com/'+scope.emailHash+'.json', + }; + scope.url = 'img/contact-placeholder.svg'; + $http(req).then(function (response) { + scope.url = 'https://secure.gravatar.com/avatar/'+scope.emailHash+'.jpg?s='+scope.width+'&d=mm'; + }, function (error) { + scope.url = 'img/contact-placeholder.svg'; + }); } }, - template: '{{ name }}' + template: '{{ name }}' }; }); diff --git a/src/js/routes.js b/src/js/routes.js index 4e72246ba..2399a2db9 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -270,6 +270,15 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } } }) + .state('tabs.send2', { + url: '/send2', + views: { + 'tab-send': { + controller: 'tabSendV2Controller', + templateUrl: 'views/tab-send-v2.html', + } + } + }) .state('tabs.settings', { url: '/settings', views: { diff --git a/src/js/services/clipboardService.js b/src/js/services/clipboardService.js index e2e0e5fb3..ff28cd2e7 100644 --- a/src/js/services/clipboardService.js +++ b/src/js/services/clipboardService.js @@ -17,7 +17,27 @@ angular.module('copayApp.services').factory('clipboardService', function ($http, // No supported return; } + }; + root.readFromClipboard = function (cb) { + $log.debug("Read from clipboard"); + if (platformInfo.isCordova) { + cordova.plugins.clipboard.paste(function(text) { + cb(text); + }) + } else if (platformInfo.isNW) { + cb(nodeWebkitService.readFromClipboard()); + } else { + navigator.clipboard.readText() + .then(text => { + cb(text); + }) + .catch(err => { + $log.debug("Clipboard reading is not supported in browser.."); + }); + + return; + } }; return root; diff --git a/src/sass/buttons.scss b/src/sass/buttons.scss index 348d6d378..a8512ae64 100644 --- a/src/sass/buttons.scss +++ b/src/sass/buttons.scss @@ -16,6 +16,8 @@ &.button-primary, &.button-secondary, &.button-light, + &.button-white, + &.button-green, &.button-assertive { &.button-standard { @extend %button-standard; @@ -33,6 +35,10 @@ } } +@mixin button-shadow() { + box-shadow: 0 2px 11px 0 #C1C1C1;; +} + .button { &.button-secondary { @include button-style($v-button-secondary-bg, $v-button-secondary-border, $v-button-secondary-active-bg, $v-button-secondary-active-border, $v-button-secondary-color); @@ -47,7 +53,24 @@ } .button { + border-radius: 6px; &.button-full { display: block; } + &-green { + @include button-style(#719561, #FFF, #606060, #FFF, #FFF); + @include button-clear(#FFF); + @include button-outline(#C1C1C1); + border: 0px; + @include button-shadow(); + } + &-white { + @include button-style(#FFF, #C1C1C1, #C1C1C1, #FFF, #606060); + @include button-clear(#FFF); + @include button-outline(#C1C1C1); + @include button-shadow(); + &.activated { + color: #FFF; + } + } } \ No newline at end of file diff --git a/src/sass/views/address-book.scss b/src/sass/views/address-book.scss index c0d0f99a8..8bbdbc6be 100644 --- a/src/sass/views/address-book.scss +++ b/src/sass/views/address-book.scss @@ -124,7 +124,6 @@ position: relative; height: 70px; border-color: $royal; - background-color: $royal; padding-top: 20px; margin-bottom: 50px; text-align: center; diff --git a/src/sass/views/tab-send-v2.scss b/src/sass/views/tab-send-v2.scss new file mode 100644 index 000000000..e9905fc17 --- /dev/null +++ b/src/sass/views/tab-send-v2.scss @@ -0,0 +1,228 @@ +#tab-send2 { + @extend .deflash-blue; + .input { + width: 100%; + input { + width: 100%; + height: 57px; + background: #FFF; + border: 1px #D9D9D9 solid; + &::placeholder { + color: #DCDCDC; + } + } + i { + &.left { + padding-left: 15px; + } + &.qr { + cursor: pointer; + cursor: hand; + padding-right: 5px; + } + } + } + + .send-wrapper { + &:after { + display: block; + position: relative; + height: 1px; + background: #DEDEDE; + bottom: 0; + content: ''; + margin: 20px 6px 0px; + } + margin: 18px 0 0; + padding: 9px; + background-color: #f2f2f2; + border-radius: 3px; + border: none; + &.focus { + .search-input { + padding-left: 30px; + &:focus::-webkit-input-placeholder { + opacity: 0; + } + } + } + .buttons { + margin: auto; + margin-top: 18px; + .button { + &-clipboard-paste { + margin-left: 0; + .address { + display: none; + } + .icon { + background: url(../img/icon-clipboard-paste.svg); + width: 15px; + height: 19px; + display: inline-block; + margin-bottom: 4px; + } + &.contains-address { + background: #FAB915; + color: #FFF !important; + border: 0; + @include button-shadow(); + .icon { + background: url(../img/icon-clipboard-paste-white.svg); + } + .address { + display: inline; + } + .non-address { + display: none; + } + } + } + span { + font-size: 14px; + } + img { + height: 16px; + width: auto; + margin: 2px 0 4px; + } + height: 60px; + line-height: 16px; + margin-right: 0px; + width: 95%; + max-width: none; + padding: 2px; + &-qr { + font-weight: bold; + max-width: none; + width: 100%; + height: 95px; + margin-top: 20px; + img { + vertical-align: middle; + margin-right: 12px; + width: 43px; + height: 43px; + } + span { + font-size: 19px; + } + } + } + } + } + .search-input { + background-color: transparent; + padding-left: 30px; + } + .sendTip { + padding-top: 5vh; + text-align: center; + .item { + border-style: none; + } + & > .title { + font-size: 20px; + color: $v-dark-gray; + margin: 20px 10px; + } + & > .subtitle { + font-size: 1rem; + line-height: 1.5em; + font-weight: 300; + color: #6F6F70; + margin: 20px 1em 2.5em; + } + .big-icon-svg { + .bg.green { + padding: 0 10px; + box-shadow: none; + } + } + .buttons { + margin-top: 18px; + .button { + font-weight: bold; + font-size: 19px; + } + } + .button-first-contact img { + height: 19px; + width: 19px; + margin-right: 6px; + vertical-align: sub; + } + } + .item-heading { + line-height: 16px; + font-size: 14px; + font-weight: bold; + .subtitle { + color: #B5B2B2; + font-size: 12px; + font-weight: 300; + } + } + .list { + .item { + font-weight: 600; + padding-top: 12px; + padding-bottom: 12px; + p { + font-weight: normal; + } + &.item-icon-left { + padding-left: 64px; + } + color: #444; + //border-top: none; + padding-top: 1.5rem; + padding-bottom: 1.5rem; + .big-icon-svg { + left: 5px; + & > .bg { + width: 30px; + height: 30px; + box-shadow: none; + } + } + &:before { + display: block; + position: absolute; + width: 100%; + height: 1px; + background: rgba(221, 221, 221, 0.3); + top: 0; + right: 0; + content: ''; + } + &.item-divider { + color: rgba(74, 74, 74, .8); + } + &.item-heading { + &:before { + top: 99%; + width: 100%; + } + } + &:nth-child(2) { + &:before { + width: 0; + } + } + .item-note { + color: rgb(58, 58, 58); + } + } + } + .scroll { + height: 100%; + } + + .card.contacts { + margin: 4px; + border-radius: 6px; + box-shadow: 0px 2px 1px 0 #C1C1C1; + } + +} diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 37754970f..5367ac5aa 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -8,6 +8,7 @@ @import "tab-receive"; @import "tab-scan"; @import "tab-send"; +@import "tab-send-v2"; @import "tab-settings"; @import "wallet-colors"; @import "walletBalance"; diff --git a/www/img/contact-placeholder.svg b/www/img/contact-placeholder.svg index f730da86b..54b0fcec2 100644 --- a/www/img/contact-placeholder.svg +++ b/www/img/contact-placeholder.svg @@ -1,12 +1,18 @@ - - - - - - + + + + Artboard + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/img/icon-clipboard-paste-white.svg b/www/img/icon-clipboard-paste-white.svg new file mode 100644 index 000000000..be0df78bc --- /dev/null +++ b/www/img/icon-clipboard-paste-white.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/www/img/icon-clipboard-paste.svg b/www/img/icon-clipboard-paste.svg new file mode 100644 index 000000000..a82edc11b --- /dev/null +++ b/www/img/icon-clipboard-paste.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/www/img/icon-contact-add.svg b/www/img/icon-contact-add.svg new file mode 100644 index 000000000..36d1f95bc --- /dev/null +++ b/www/img/icon-contact-add.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/www/img/icon-scan-qr.svg b/www/img/icon-scan-qr.svg new file mode 100644 index 000000000..bc4a2bc56 --- /dev/null +++ b/www/img/icon-scan-qr.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/img/icon-w2w.svg b/www/img/icon-w2w.svg new file mode 100644 index 000000000..082a0d8cc --- /dev/null +++ b/www/img/icon-w2w.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/www/views/tab-send-v2.html b/www/views/tab-send-v2.html new file mode 100644 index 000000000..b42784957 --- /dev/null +++ b/www/views/tab-send-v2.html @@ -0,0 +1,143 @@ + + + {{'Send' | translate}} + + +
+
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+ +
+ +
+
+
+ Your Bitcoin wallet is empty +
+
+
+

To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.

+

You can receive bitcoin from any wallet or service.

+
+
To get started, you'll need to create a bitcoin wallet and get some + bitcoin. +
+
+ + + +
+
+
+
+
+
+
+ +
+
Contacts
+
Saved frequently used addresses
+ + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/views/tabs.html b/www/views/tabs.html index 69cf93309..19c33aad9 100644 --- a/www/views/tabs.html +++ b/www/views/tabs.html @@ -12,7 +12,7 @@ - + From 658a91e9ccbda784a1ab0d9d8c2276ba15b6d09e Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Tue, 10 Jul 2018 09:54:49 +0200 Subject: [PATCH 05/44] round gravatar --- src/sass/views/tab-send-v2.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sass/views/tab-send-v2.scss b/src/sass/views/tab-send-v2.scss index e9905fc17..a44973285 100644 --- a/src/sass/views/tab-send-v2.scss +++ b/src/sass/views/tab-send-v2.scss @@ -223,6 +223,9 @@ margin: 4px; border-radius: 6px; box-shadow: 0px 2px 1px 0 #C1C1C1; + .gravatar { + border-radius: 30px; + } } } From 94e6dd7dac86c96c3b320eec3afa1b72a81c1731 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Tue, 10 Jul 2018 11:08:03 +0200 Subject: [PATCH 06/44] clipboard features --- src/js/controllers/tab-send-v2.js | 20 +++++++++++++++----- src/sass/views/tab-send-v2.scss | 17 +++++++++++------ www/views/tab-send-v2.html | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/js/controllers/tab-send-v2.js b/src/js/controllers/tab-send-v2.js index 624acb5bb..5c75957c4 100644 --- a/src/js/controllers/tab-send-v2.js +++ b/src/js/controllers/tab-send-v2.js @@ -2,6 +2,7 @@ angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; + var clipboardHasContent = false; $scope.addContact = function() { $state.go('tabs.settings').then(function() { @@ -12,19 +13,28 @@ angular.module('copayApp.controllers').controller('tabSendV2Controller', functio }; $scope.pasteClipboard = function() { - clipboardService.readFromClipboard(function(text) { - $scope.formData.search = text; - $scope.findContact($scope.formData.search); - }); - } + if ($scope.clipboardHasAddress || $scope.clipboardHasContent) { + clipboardService.readFromClipboard(function(text) { + $scope.formData.search = text; + $scope.findContact($scope.formData.search); + }); + } + }; $scope.$on("$ionicView.enter", function(event, data) { clipboardService.readFromClipboard(function(text) { + if (text.length > 200) { + text = text.substring(0, 200); + } + $scope.clipboardHasAddress = false; + $scope.clipboardHasContent = false; if ((text.indexOf('bitcoincash:') === 0 || text[0] === 'C' || text[0] === 'H' || text[0] === 'p' || text[0] === 'q') && text.replace('bitcoincash:', '').length === 42) { // CashAddr $scope.clipboardHasAddress = true; } else if ((text[0] === "1" || text[0] === "3" || text.substring(0, 3) === "bc1") && text.length >= 26 && text.length <= 35) { // Legacy Addresses $scope.clipboardHasAddress = true; + } else if (text.length > 1) { + $scope.clipboardHasContent = true; } }); diff --git a/src/sass/views/tab-send-v2.scss b/src/sass/views/tab-send-v2.scss index a44973285..630828ae0 100644 --- a/src/sass/views/tab-send-v2.scss +++ b/src/sass/views/tab-send-v2.scss @@ -62,7 +62,10 @@ display: inline-block; margin-bottom: 4px; } - &.contains-address { + &.contains-address, &.contains-content { + .address { + display: none; + } background: #FAB915; color: #FFF !important; border: 0; @@ -70,11 +73,13 @@ .icon { background: url(../img/icon-clipboard-paste-white.svg); } - .address { - display: inline; - } - .non-address { - display: none; + &.contains-address { + .address { + display: inline; + } + .non-address { + display: none; + } } } } diff --git a/www/views/tab-send-v2.html b/www/views/tab-send-v2.html index b42784957..510633a3a 100644 --- a/www/views/tab-send-v2.html +++ b/www/views/tab-send-v2.html @@ -15,7 +15,7 @@
- -
-
- -
-
-
- -
-
-
-
- -
-
-
- Send Bitcoin faster! -
-
-
-

Save frequently used addresses and send them Bitcoin in just one tap

-
- -
-
-
- -
-
-
- Your Bitcoin wallet is empty -
-
-
-

To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.

-

You can receive bitcoin from any wallet or service.

-
-
To get started, you'll need to create a bitcoin wallet and get some - bitcoin. -
-
- - - -
-
-
-
-
-
-
- -
-
Contacts
-
Saved frequently used addresses
- - - -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 838c04299..a3a0b99d4 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -3,15 +3,57 @@ {{'Send' | translate}} -
-
-
Recipient
-
- -
- - +
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+ Send Bitcoin faster! +
+
+
+

Save frequently used addresses and send them Bitcoin in just one tap

+
+
@@ -19,72 +61,83 @@
-
-
- - - -
- Start sending bitcoin + Your Bitcoin wallet is empty
- To get started, buy bitcoin or share your address. You can receive bitcoin from any wallet or service. - To get started, you'll need to create a bitcoin wallet and get some bitcoin. -
- - - +
+

To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.

+

You can receive bitcoin from any wallet or service.

+
+
To get started, you'll need to create a bitcoin wallet and get some + bitcoin. +
+
+ + + +
+
+
+
+
+
+
+ +
+
Contacts
+
Saved frequently used addresses
+ + + +
+
- - -
-
- Transfer to Wallet - - -
- -
+ + + + + + + + + + + + + + + + + + + + + From 39cb416c300f2b692f37c67564fbdde72da14d55 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Tue, 10 Jul 2018 11:12:43 +0200 Subject: [PATCH 08/44] changed route and tab --- src/js/routes.js | 9 --------- www/views/tabs.html | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/js/routes.js b/src/js/routes.js index 2399a2db9..4e72246ba 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -270,15 +270,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } } }) - .state('tabs.send2', { - url: '/send2', - views: { - 'tab-send': { - controller: 'tabSendV2Controller', - templateUrl: 'views/tab-send-v2.html', - } - } - }) .state('tabs.settings', { url: '/settings', views: { diff --git a/www/views/tabs.html b/www/views/tabs.html index 19c33aad9..69cf93309 100644 --- a/www/views/tabs.html +++ b/www/views/tabs.html @@ -12,7 +12,7 @@ - + From 5070a0042c15abbe55b494d04a1a1faf55399692 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Tue, 10 Jul 2018 11:15:17 +0200 Subject: [PATCH 09/44] small refactor --- src/js/controllers/tab-send.js | 2 +- src/sass/views/views.scss | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 5c75957c4..a4c4a7152 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 5367ac5aa..37754970f 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -8,7 +8,6 @@ @import "tab-receive"; @import "tab-scan"; @import "tab-send"; -@import "tab-send-v2"; @import "tab-settings"; @import "wallet-colors"; @import "walletBalance"; From e6da12c17e894c0072c4de53f68527eeedfc146b Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Tue, 10 Jul 2018 14:27:51 +0200 Subject: [PATCH 10/44] tab-send --- src/js/controllers/tab-send.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 5c75957c4..a4c4a7152 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; From 7cc806b00c1fbdc7e23d7f34b46bf2fc84a0b58c Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Tue, 10 Jul 2018 15:11:17 +0200 Subject: [PATCH 11/44] Filter contacts on "starting with" instead of "contains" and some refactors --- src/js/controllers/tab-send.js | 104 +++++++++------------------------ www/views/tab-send.html | 3 - 2 files changed, 29 insertions(+), 78 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index a4c4a7152..f9a58e94c 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -3,6 +3,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; + var originalList; $scope.addContact = function() { $state.go('tabs.settings').then(function() { @@ -50,27 +51,26 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }); }); + $scope.findContact = function(search) { + if (incomingData.redir(search)) { + return; + } + if (!search || search.length < 1) { + $scope.list = originalList; + $timeout(function() { + $scope.$apply(); + }); + return; + } + var result = lodash.filter(originalList, function(item) { + var val = item.name; + return lodash.startsWith(val.toLowerCase(), search.toLowerCase()); + }); - - - - - - - - - - - - var originalList; - var CONTACTS_SHOW_LIMIT; - var currentContactsPage; - - $scope.sectionDisplay = { - transferToWallet: false + $scope.list = result; }; var hasWallets = function() { @@ -80,6 +80,8 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.hasWallets = lodash.isEmpty($scope.wallets) ? false : true; }; + + // THIS is ONLY to show the 'buy bitcoins' message // does not has any other function. @@ -138,12 +140,12 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var walletList = []; lodash.each(walletsToTransfer, function(v) { - var displayBalanceAsFiat = - // BD got v.status as undefined here once during development, just - // after creating a new wallet. - v.status && - v.status.alternativeBalanceAvailable && - config.wallet.settings.priceDisplay === 'fiat'; + var displayBalanceAsFiat = + // BD got v.status as undefined here once during development, just + // after creating a new wallet. + v.status && + v.status.alternativeBalanceAvailable && + config.wallet.settings.priceDisplay === 'fiat'; walletList.push({ color: v.color, @@ -152,7 +154,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( coin: v.coin, network: v.network, balanceString: displayBalanceAsFiat ? - v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode : + v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode : v.cachedBalance, getAddress: function(cb) { walletService.getAddress(v, false, cb); @@ -181,16 +183,14 @@ angular.module('copayApp.controllers').controller('tabSendController', function( recipientType: 'contact', coin: v.coin, displayCoin: (v.coin == 'bch' - ? (config.bitcoinCashAlias || defaults.bitcoinCashAlias) - : (config.bitcoinAlias || defaults.bitcoinAlias)).toUpperCase(), + ? (config.bitcoinCashAlias || defaults.bitcoinCashAlias) + : (config.bitcoinAlias || defaults.bitcoinAlias)).toUpperCase(), getAddress: function(cb) { return cb(null, k); }, }); }); - var contacts = completeContacts.slice(0, (currentContactsPage + 1) * CONTACTS_SHOW_LIMIT); - $scope.contactsShowMore = completeContacts.length > contacts.length; - originalList = originalList.concat(contacts); + originalList = completeContacts; return cb(); }); }; @@ -203,28 +203,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }, 10); }; - $scope.openScanner = function() { - var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP; - - if (!isWindowsPhoneApp) { - $state.go('tabs.scan'); - return; - } - - scannerService.useOldScanner(function(err, contents) { - if (err) { - popupService.showAlert(gettextCatalog.getString('Error'), err); - return; - } - incomingData.redir(contents); - }); - }; - - $scope.showMore = function() { - currentContactsPage++; - updateWalletsList(); - }; - $scope.searchInFocus = function() { $scope.searchFocus = true; }; @@ -235,28 +213,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } }; - $scope.findContact = function(search) { - - if (incomingData.redir(search)) { - return; - } - - if (!search || search.length < 2) { - $scope.list = originalList; - $timeout(function() { - $scope.$apply(); - }); - return; - } - - var result = lodash.filter(originalList, function(item) { - var val = item.name; - return lodash.includes(val.toLowerCase(), search.toLowerCase()); - }); - - $scope.list = result; - }; - $scope.goToAmount = function(item) { $timeout(function() { item.getAddress(function(err, addr) { @@ -304,8 +260,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( search: null }; originalList = []; - CONTACTS_SHOW_LIMIT = 10; - currentContactsPage = 0; hasWallets(); }); }); diff --git a/www/views/tab-send.html b/www/views/tab-send.html index a3a0b99d4..3346ebf71 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -109,9 +109,6 @@

-
- Show more -
From 41a2a3c97123566d2367082d7fe598706c92076c Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 11 Jul 2018 14:36:22 +0200 Subject: [PATCH 12/44] scrollable contact view + better quality contact icons --- src/sass/views/tab-send.scss | 26 +++++++++++++++++++------- www/views/tab-send.html | 6 +++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/sass/views/tab-send.scss b/src/sass/views/tab-send.scss index aabb76cda..f2d0dd1dd 100644 --- a/src/sass/views/tab-send.scss +++ b/src/sass/views/tab-send.scss @@ -1,5 +1,18 @@ #tab-send { @extend .deflash-blue; + + &-header{ + position: absolute; + height: 300px; + width: 100%; + } + &-contacts { + position: absolute; + top: 300px; + height: calc(100vh - 300px - 50px - 44px); + overflow: scroll; + } + .input { width: 100%; input { @@ -31,10 +44,9 @@ background: #DEDEDE; bottom: 0; content: ''; - margin: 20px 6px 0px; + margin: 10px 6px 0px; } - margin: 18px 0 0; - padding: 9px; + padding: 18px 9px 9px 9px; background-color: #f2f2f2; border-radius: 3px; border: none; @@ -171,8 +183,6 @@ .list { .item { font-weight: 600; - padding-top: 12px; - padding-bottom: 12px; p { font-weight: normal; } @@ -181,8 +191,8 @@ } color: #444; //border-top: none; - padding-top: 1.5rem; - padding-bottom: 1.5rem; + padding-top: 0.6rem; + padding-bottom: 0.6rem;; .big-icon-svg { left: 5px; & > .bg { @@ -230,6 +240,8 @@ box-shadow: 0px 2px 1px 0 #C1C1C1; .gravatar { border-radius: 30px; + height: 40px; + width: 40px; } } diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 3346ebf71..98bdae6f5 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -3,7 +3,7 @@ {{'Send' | translate}} -
+
@@ -86,7 +86,7 @@
-
+
@@ -101,7 +101,7 @@ - + {{item.name}}

From be32f53668a5d39094d81a46f315465542376b5f Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 11 Jul 2018 17:31:58 +0200 Subject: [PATCH 13/44] Wallet 2 wallet transfer --- src/js/controllers/tab-send.js | 83 +++++++++++++--------------------- www/views/tab-send.html | 34 ++++---------- 2 files changed, 41 insertions(+), 76 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index f9a58e94c..5c9ee4f5d 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -45,12 +45,42 @@ angular.module('copayApp.controllers').controller('tabSendController', function( return; } updateHasFunds(); - updateWalletsList(); updateContactsList(function() { updateList(); }); }); + var walletToWalletFrom = false; + var walletToWalletTo = false; + + $scope.onWalletSelect = function(wallet) { + if (!$scope.walletToWalletFrom) { + $scope.walletToWalletFrom = wallet; + $scope.walletSelectorTitle = gettextCatalog.getString('Send to'); + $timeout(function(){ + $scope.showWallets = true; + }, 200); + + } else { + $scope.walletToWalletTo = wallet; + walletService.getAddress($scope.walletToWalletFrom, true, function(err, addr) { + return $state.transitionTo('tabs.send.amount', { + displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, + fromWalletId: $scope.walletToWalletFrom.walletId, + toAddress: addr, + coin: $scope.walletToWalletFrom.coin + }); + }); + + } + }; + + $scope.showWalletSelector = function() { + $scope.walletToWalletFrom = false; + $scope.walletSelectorTitle = gettextCatalog.getString('Send from'); + $scope.showWallets = true; + }; + $scope.findContact = function(search) { if (incomingData.redir(search)) { @@ -80,11 +110,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.hasWallets = lodash.isEmpty($scope.wallets) ? false : true; }; - - - // THIS is ONLY to show the 'buy bitcoins' message - // does not has any other function. - var updateHasFunds = function() { if ($rootScope.everHasFunds) { @@ -119,52 +144,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }); }; - var updateWalletsList = function() { - var config = configService.getSync(); - var networkResult = lodash.countBy($scope.wallets, 'network'); - - $scope.showTransferCard = $scope.hasWallets && (networkResult.livenet > 1 || networkResult.testnet > 1); - - if ($scope.showTransferCard) { - var walletsToTransfer = $scope.wallets; - if (!(networkResult.livenet > 1)) { - walletsToTransfer = lodash.filter(walletsToTransfer, function(item) { - return item.network == 'testnet'; - }); - } - if (!(networkResult.testnet > 1)) { - walletsToTransfer = lodash.filter(walletsToTransfer, function(item) { - return item.network == 'livenet'; - }); - } - - var walletList = []; - lodash.each(walletsToTransfer, function(v) { - var displayBalanceAsFiat = - // BD got v.status as undefined here once during development, just - // after creating a new wallet. - v.status && - v.status.alternativeBalanceAvailable && - config.wallet.settings.priceDisplay === 'fiat'; - - walletList.push({ - color: v.color, - name: v.name, - recipientType: 'wallet', - coin: v.coin, - network: v.network, - balanceString: displayBalanceAsFiat ? - v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode : - v.cachedBalance, - getAddress: function(cb) { - walletService.getAddress(v, false, cb); - }, - }); - }); - originalList = originalList.concat(walletList); - } - } - var updateContactsList = function(cb) { var config = configService.getSync(); var defaults = configService.getDefaults(); diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 98bdae6f5..a2174e1fa 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -22,7 +22,7 @@

- @@ -113,28 +113,14 @@
- - - - - - - - - - - - - - - - - - - - - - - + + From d8785f7928698c62f6253bb53cccc80d2b72a06f Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Wed, 11 Jul 2018 17:34:32 +0200 Subject: [PATCH 14/44] remove hide titles --- www/views/tab-send.html | 1 - 1 file changed, 1 deletion(-) diff --git a/www/views/tab-send.html b/www/views/tab-send.html index a2174e1fa..e11d9c8ef 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -116,7 +116,6 @@ Date: Thu, 12 Jul 2018 15:25:11 +0200 Subject: [PATCH 15/44] Wallet to wallet flow --- src/js/controllers/tab-send.js | 39 ++++++++++++++++++++------ src/js/directives/walletSelector.js | 2 ++ www/views/includes/walletSelector.html | 2 +- www/views/tab-send.html | 20 ++++++++++++- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 5c9ee4f5d..66ac10b14 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -4,6 +4,8 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var clipboardHasAddress = false; var clipboardHasContent = false; var originalList; + $scope.displayBalanceAsFiat = true; + $scope.walletSelectorTitleForce = true; $scope.addContact = function() { $state.go('tabs.settings').then(function() { @@ -50,22 +52,25 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }); }); + var wallets; + var walletsBch; + var walletsBtc; var walletToWalletFrom = false; - var walletToWalletTo = false; $scope.onWalletSelect = function(wallet) { if (!$scope.walletToWalletFrom) { $scope.walletToWalletFrom = wallet; - $scope.walletSelectorTitle = gettextCatalog.getString('Send to'); - $timeout(function(){ - $scope.showWallets = true; - }, 200); - + if (wallet.coin === 'bch') { + $scope.showWalletsBch = true; + } else if (wallet.coin === 'btc') { + $scope.showWalletsBtc = true; + } + $scope.walletSelectorTitleTo = gettextCatalog.getString('Send to'); } else { - $scope.walletToWalletTo = wallet; - walletService.getAddress($scope.walletToWalletFrom, true, function(err, addr) { + walletService.getAddress(wallet, true, function(err, addr) { return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, + recipientType: 'wallet', fromWalletId: $scope.walletToWalletFrom.walletId, toAddress: addr, coin: $scope.walletToWalletFrom.coin @@ -77,7 +82,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.showWalletSelector = function() { $scope.walletToWalletFrom = false; - $scope.walletSelectorTitle = gettextCatalog.getString('Send from'); + $scope.walletSelectorTitleFrom = gettextCatalog.getString('Send from'); $scope.showWallets = true; }; @@ -107,6 +112,14 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.wallets = profileService.getWallets({ onlyComplete: true }); + $scope.walletsBch = profileService.getWallets({ + onlyComplete: true, + coin: 'bch' + }); + $scope.walletsBtc = profileService.getWallets({ + onlyComplete: true, + coin: 'btc' + }); $scope.hasWallets = lodash.isEmpty($scope.wallets) ? false : true; }; @@ -234,11 +247,19 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }; $scope.$on("$ionicView.beforeEnter", function(event, data) { + $scope.showWalletsBch = $scope.showWalletsBtc = $scope.showWallets = false; + $scope.checkingBalance = true; $scope.formData = { search: null }; originalList = []; hasWallets(); + + configService.whenAvailable(function(_config) { + $scope.displayBalanceAsFiat = _config.wallet.settings.priceDisplay === 'fiat'; + config = _config; + }); + }); }); diff --git a/src/js/directives/walletSelector.js b/src/js/directives/walletSelector.js index 79053f812..dabd1fbcd 100644 --- a/src/js/directives/walletSelector.js +++ b/src/js/directives/walletSelector.js @@ -8,6 +8,7 @@ angular.module('copayApp.directives') transclude: true, scope: { title: '=walletSelectorTitle', + forceTitle: '=walletSelectorForceTitle', show: '=walletSelectorShow', wallets: '=walletSelectorWallets', selectedWallet: '=walletSelectorSelectedWallet', @@ -15,6 +16,7 @@ angular.module('copayApp.directives') displayBalanceAsFiat : '=walletSelectorDisplayBalanceAsFiat' }, link: function(scope, element, attrs) { + console.log(scope, element, attrs); scope.hide = function() { scope.show = false; }; diff --git a/www/views/includes/walletSelector.html b/www/views/includes/walletSelector.html index 136aa4694..97dfeb552 100644 --- a/www/views/includes/walletSelector.html +++ b/www/views/includes/walletSelector.html @@ -5,7 +5,7 @@ ng-init="wallet.coin == 'btc' ? walletsBtc.push(wallet) : walletsBch.push(wallet)"> -
{{title}}
+
{{title}}
Bitcoin Cash (BCH)
diff --git a/www/views/tab-send.html b/www/views/tab-send.html index e11d9c8ef..c261ad06d 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -115,11 +115,29 @@
+ + + + + From 554d40d08f6d0fb1af66567dc78fccc9f6e9b372 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 12 Jul 2018 15:25:42 +0200 Subject: [PATCH 16/44] config variable --- src/js/controllers/tab-send.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 66ac10b14..f1f1d6116 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -258,7 +258,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( configService.whenAvailable(function(_config) { $scope.displayBalanceAsFiat = _config.wallet.settings.priceDisplay === 'fiat'; - config = _config; }); }); From a3ef304e09890edbc7242773bbe28145947820a4 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Thu, 12 Jul 2018 17:40:31 +0200 Subject: [PATCH 17/44] wallet to wallet back-button --- src/js/controllers/tab-send.js | 7 +++++++ src/js/directives/walletSelector.js | 4 ++++ www/views/tab-send.html | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index f1f1d6116..a90effe7b 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -7,6 +7,13 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.displayBalanceAsFiat = true; $scope.walletSelectorTitleForce = true; + + + $scope.walletHide = function() { + console.log("wallet HIDE"); + alert('test'); + }; + $scope.addContact = function() { $state.go('tabs.settings').then(function() { $state.go('tabs.addressbook').then(function() { diff --git a/src/js/directives/walletSelector.js b/src/js/directives/walletSelector.js index dabd1fbcd..8a96a0805 100644 --- a/src/js/directives/walletSelector.js +++ b/src/js/directives/walletSelector.js @@ -13,12 +13,16 @@ angular.module('copayApp.directives') wallets: '=walletSelectorWallets', selectedWallet: '=walletSelectorSelectedWallet', onSelect: '=walletSelectorOnSelect', + onHide: '=walletSelectorOnHide', displayBalanceAsFiat : '=walletSelectorDisplayBalanceAsFiat' }, link: function(scope, element, attrs) { console.log(scope, element, attrs); scope.hide = function() { scope.show = false; + if (typeof scope.onHide === "function") { + scope.onHide() + } }; scope.selectWallet = function(wallet) { $timeout(function() { diff --git a/www/views/tab-send.html b/www/views/tab-send.html index c261ad06d..28ba48a50 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -124,6 +124,7 @@ wallet-selector-display-balance-as-fiat="displayBalanceAsFiat">
Date: Fri, 13 Jul 2018 15:03:57 +1200 Subject: [PATCH 18/44] Shows "Empty case" send screen after sending all funds from wallets. --- src/js/controllers/tab-send.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index a90effe7b..00328d5db 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -132,11 +132,6 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var updateHasFunds = function() { - if ($rootScope.everHasFunds) { - $scope.hasFunds = true; - return; - } - $scope.hasFunds = false; var index = 0; lodash.each($scope.wallets, function(w) { @@ -151,10 +146,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.hasFunds = true; } else if (status.availableBalanceSat > 0) { $scope.hasFunds = true; - $rootScope.everHasFunds = true; } - if (index == $scope.wallets.length) { + if (index === $scope.wallets.length) { $scope.checkingBalance = false; $timeout(function() { $scope.$apply(); From eff8442f695d1ebfcbd3e89d320791d3bf1f4987 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Fri, 13 Jul 2018 15:36:34 +1200 Subject: [PATCH 19/44] "Show my address" button can now be clicked. --- www/views/tab-send.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 28ba48a50..3fabea47a 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -86,9 +86,9 @@
-
+
-
+
Contacts
From 2121155dd00252565732d76a0186e67f47617845 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Fri, 13 Jul 2018 17:18:41 +1200 Subject: [PATCH 20/44] When pasting from clipboard using the button on send screen, the text now appears the first time. --- src/js/controllers/tab-send.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 00328d5db..bcaaaef5c 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -25,7 +25,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.pasteClipboard = function() { if ($scope.clipboardHasAddress || $scope.clipboardHasContent) { clipboardService.readFromClipboard(function(text) { - $scope.formData.search = text; + $scope.$apply(function() { + $scope.formData.search = text; + }); $scope.findContact($scope.formData.search); }); } From 658c58c59fbdf1a0b4e8e37f5740caa2d3eb073b Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Fri, 13 Jul 2018 17:50:50 +1200 Subject: [PATCH 21/44] In Send screen, contacts positioned below buttons. --- src/sass/views/tab-send.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sass/views/tab-send.scss b/src/sass/views/tab-send.scss index f2d0dd1dd..717ebff89 100644 --- a/src/sass/views/tab-send.scss +++ b/src/sass/views/tab-send.scss @@ -2,13 +2,10 @@ @extend .deflash-blue; &-header{ - position: absolute; height: 300px; width: 100%; } &-contacts { - position: absolute; - top: 300px; height: calc(100vh - 300px - 50px - 44px); overflow: scroll; } From 1150e843d75900f4c2a2db11eba9458f5669a528 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Fri, 13 Jul 2018 17:50:21 +0900 Subject: [PATCH 22/44] 474 - Link updated --- src/js/services/bitcoincomService.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/services/bitcoincomService.js b/src/js/services/bitcoincomService.js index 681ed8f4d..d7883b68e 100644 --- a/src/js/services/bitcoincomService.js +++ b/src/js/services/bitcoincomService.js @@ -20,28 +20,28 @@ angular.module('copayApp.services').factory('bitcoincomService', function($http, name: 'games', title: 'Bitcoin Cash Games', icon: 'icon-games', - href: 'http://cashgames.bitcoin.com' + href: 'https://cashgames.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=CashGames' }; var newsItem = { name: 'news', title: 'News', icon: 'icon-news', - href: 'http://news.bitcoin.com' + href: 'https://news.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=News' }; var poolItem = { name: 'pool', title: 'Mining Pool', icon: 'icon-mining', - href: 'http://pool.bitcoin.com' + href: 'https://pool.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=Pool' }; var toolsItem = { name: 'tools', title: 'Tools', icon: 'icon-tools', - href: 'http://tools.bitcoin.com' + href: 'https://tools.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=Tools' }; var priceChartItem = { @@ -55,7 +55,7 @@ angular.module('copayApp.services').factory('bitcoincomService', function($http, name: 'faucet', title: 'Free Bitcoin Cash', icon: 'icon-faucet', - href: 'https://free.bitcoin.com/' + href: 'https://free.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=Faucet' }; var _getBitPay = function(endpoint) { From 63c64bce0ee795070fc4e427f5897f692c554ce3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Fri, 13 Jul 2018 17:53:18 +0900 Subject: [PATCH 23/44] 474 - Link changed --- www/views/buyBitcoindotcom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/buyBitcoindotcom.html b/www/views/buyBitcoindotcom.html index 2c8ef36f1..a8a7889e3 100644 --- a/www/views/buyBitcoindotcom.html +++ b/www/views/buyBitcoindotcom.html @@ -15,7 +15,7 @@
- +
From aed9657714d4bce025ebc9ed8eb96b60912b48e9 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Fri, 13 Jul 2018 21:02:57 +1200 Subject: [PATCH 24/44] Removed extraneous .com in email subject line. --- src/js/controllers/tab-settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js index 7106aa743..4d0636d53 100644 --- a/src/js/controllers/tab-settings.js +++ b/src/js/controllers/tab-settings.js @@ -46,7 +46,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct }; $scope.sendFeedback = function() { - var mailToLink = 'mailto:wallet@bitcoin.com?subject=Feedback%20for%20Bitcoin.com%20Wallet.com'; + var mailToLink = 'mailto:wallet@bitcoin.com?subject=Feedback%20for%20Bitcoin.com%20Wallet'; if (platformInfo.isNW) { nw.Shell.openExternal(mailToLink); } else if (platformInfo.isCordova) { From 04b5a5103e268f894726071aad47a8b8d2d81bf8 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Fri, 13 Jul 2018 21:36:35 +1200 Subject: [PATCH 25/44] Fixed up last merge by removing feedbackService parameter. --- src/js/controllers/tab-home.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 43021d7e2..a04820ebd 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('tabHomeController', - function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, bannerService, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) { + function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, bannerService, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) { var wallet; var listeners = []; var notifications = []; From 02e22517cbde7a17980dd5ccff7cbf7de949b91b Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 13 Jul 2018 11:44:24 +0200 Subject: [PATCH 26/44] scrollable contacts fix --- src/js/controllers/tab-send.js | 1 + src/sass/views/tab-send.scss | 5 ++++- www/views/tab-send.html | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index bcaaaef5c..e0806816b 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -250,6 +250,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }; $scope.$on("$ionicView.beforeEnter", function(event, data) { + $scope.isIOS = platformInfo.isIOS && platformInfo.isCordova; $scope.showWalletsBch = $scope.showWalletsBtc = $scope.showWallets = false; $scope.checkingBalance = true; diff --git a/src/sass/views/tab-send.scss b/src/sass/views/tab-send.scss index 717ebff89..89c2fc2c4 100644 --- a/src/sass/views/tab-send.scss +++ b/src/sass/views/tab-send.scss @@ -6,7 +6,10 @@ width: 100%; } &-contacts { - height: calc(100vh - 300px - 50px - 44px); + height: calc(100vh - 300px /* button container */ - 50px /* bottom-tab-menu */ - 44px /* header top */); + &.ios { + height: calc(100vh - 300px - 50px - 44px - 20pt); // Remove the notification-bar height on iOS + } overflow: scroll; } diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 3fabea47a..4d9506592 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -86,10 +86,9 @@
-
+
-
Contacts
Saved frequently used addresses
From ca7cd448101c3e9ff6d06d1d9d14de8d4d963c55 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 13 Jul 2018 12:46:06 +0200 Subject: [PATCH 27/44] iPhone SE styles --- src/sass/views/tab-send.scss | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/sass/views/tab-send.scss b/src/sass/views/tab-send.scss index 89c2fc2c4..a4025156f 100644 --- a/src/sass/views/tab-send.scss +++ b/src/sass/views/tab-send.scss @@ -6,9 +6,9 @@ width: 100%; } &-contacts { - height: calc(100vh - 300px /* button container */ - 50px /* bottom-tab-menu */ - 44px /* header top */); + height: calc(100vh - 300px - 50px - 44px); /* screen size - button container - bottom-tab-menu - header top */ &.ios { - height: calc(100vh - 300px - 50px - 44px - 20pt); // Remove the notification-bar height on iOS + height: calc(100vh - 300px - 50px - 44px - 18px); // Remove the notification-bar height on iOS } overflow: scroll; } @@ -235,7 +235,8 @@ } .card.contacts { - margin: 4px; + margin: 4px 4px 16px 4px; + border-radius: 6px; box-shadow: 0px 2px 1px 0 #C1C1C1; .gravatar { @@ -245,4 +246,24 @@ } } + + ///* iPhone 5/SE and other small screen devices */ + @media only screen and (min-device-width : 320px) and (max-device-width : 568px) { + .send-wrapper .buttons .button-qr { + height: 60px; + span { + font-size: 16px; + } + } + #tab-send-header { + height: 270px; + } + #tab-send-contacts { + height: calc(100vh - 270px - 50px - 44px); /* screen size - button container - bottom-tab-menu - header top */ + &.ios { + height: calc(100vh - 270px - 50px - 44px - 18px); // Remove the notification-bar height on iOS + } + } + } + } From c515a080e5061bada67d2d6f41809b3bf03a3979 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 13 Jul 2018 13:01:30 +0200 Subject: [PATCH 28/44] translations + fixed the tags for those --- i18n/po/template.pot | 69 +++++++++++++++++++++++++++++++++++++++-- www/views/tab-send.html | 28 ++++++----------- 2 files changed, 77 insertions(+), 20 deletions(-) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index 66a2e7ca8..12a9c1f5c 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -610,10 +610,14 @@ msgstr "" msgid "Connection reset by peer" msgstr "" -#: www/views/tab-send.html:45 +#: www/views/tab-send.html:85 msgid "Contacts" msgstr "" +#: www/views/tab-send.html:86 +msgid "Saved frequently used addresses" +msgstr "" + #: www/views/onboarding/notifications.html:9 msgid "Continue" msgstr "" @@ -814,7 +818,7 @@ msgstr "" #: www/views/onboarding/tour.html:51 #: www/views/tab-home.html:75 -#: www/views/tab-send.html:36 +#: www/views/tab-send.html:75 msgid "Create bitcoin wallet" msgstr "" @@ -2582,9 +2586,70 @@ msgid "Send by email" msgstr "" #: src/js/controllers/confirm.js:177 +#: src/js/controllers/tab-send.js:94 msgid "Send from" msgstr "" +#: src/js/controllers/tab-send.js:77 +msgid "Send to" +msgstr "" + +#: www/views/tab-send.html:20 +msgid "Paste Clipboard" +msgstr "" + +#: www/views/tab-send.html:21 +msgid "Paste Address" +msgstr "" + +#: www/views/tab-send.html:27 +msgid "Wallet to Wallet Transfer" +msgstr "" + +#: www/views/tab-send.html:35 +msgid "Scan QR Code" +msgstr "" + +#: www/views/tab-send.html:46 +msgid "Send Bitcoin faster!" +msgstr "" + +#: www/views/tab-send.html:46 +msgid "Send Bitcoin faster!" +msgstr "" + +#: www/views/tab-send.html:50 +msgid "Save frequently used addresses and send them Bitcoin in just one tap" +msgstr "" + +#: www/views/tab-send.html:55 +msgid "Add your first contact" +msgstr "" + +#: www/views/tab-send.html:65 +msgid "Your Bitcoin wallet is empty" +msgstr "" + +#: www/views/tab-send.html:69 +msgid "To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address." +msgstr "" + +#: www/views/tab-send.html:70 +msgid "You can receive bitcoin from any wallet or service." +msgstr "" + +#: www/views/tab-send.html:72 +msgid "To get started, you'll need to create a bitcoin wallet and get some bitcoin." +msgstr "" + +#: www/views/tab-send.html:74 +msgid "Buy Bitcoin now" +msgstr "" + +#: www/views/tab-send.html:76 +msgid "Show my address" +msgstr "" + #: www/views/includes/itemSelector.html:8 msgid "Send max amount" msgstr "" diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 4d9506592..6bd32398d 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -46,8 +46,8 @@ Send Bitcoin faster!
-
-

Save frequently used addresses and send them Bitcoin in just one tap

+
+

Save frequently used addresses and send them Bitcoin in just one tap

-
-

To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.

-

You can receive bitcoin from any wallet or service.

-
-
To get started, you'll need to create a bitcoin wallet and get some - bitcoin. +
+

To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.

+

You can receive bitcoin from any wallet or service.

+
To get started, you'll need to create a bitcoin wallet and get some bitcoin.
- - - + + +
@@ -91,7 +83,7 @@
Contacts
-
Saved frequently used addresses
+
Saved frequently used addresses
From 501e8ce7384e251d940e55fcb8cb65bcb57790bc Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 13 Jul 2018 14:02:48 +0200 Subject: [PATCH 29/44] Only show "from"-wallets with balance --- src/js/controllers/tab-send.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index e0806816b..c13a27f7e 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -119,7 +119,8 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var hasWallets = function() { $scope.wallets = profileService.getWallets({ - onlyComplete: true + onlyComplete: true, + hasFunds: true }); $scope.walletsBch = profileService.getWallets({ onlyComplete: true, From 358ae5842cf243d58e351eef868f84bd40909c40 Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 13 Jul 2018 14:16:15 +0200 Subject: [PATCH 30/44] Clipboard empty message + translations --- i18n/po/template.pot | 8 ++++++++ src/js/controllers/tab-send.js | 14 ++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index 12a9c1f5c..a23e5dbae 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -2528,6 +2528,14 @@ msgstr "" msgid "Search or enter bitcoin address" msgstr "" +#: src/js/controllers/tab-send.js:28 +msgid "Clipboard" +msgstr "" + +#: src/js/controllers/tab-send.js:29 +msgid "Your Clipboard is empty" +msgstr "" + #: www/views/modals/search.html:16 msgid "Search transactions" msgstr "" diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index c13a27f7e..3c73c229c 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,19 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; var originalList; $scope.displayBalanceAsFiat = true; $scope.walletSelectorTitleForce = true; - - - $scope.walletHide = function() { - console.log("wallet HIDE"); - alert('test'); - }; - $scope.addContact = function() { $state.go('tabs.settings').then(function() { $state.go('tabs.addressbook').then(function() { @@ -30,6 +23,11 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }); $scope.findContact($scope.formData.search); }); + } else { + $ionicPopup.alert({ + title: gettextCatalog.getString('Clipboard'), + template: gettextCatalog.getString('Your Clipboard is empty') + }); } }; From 00b4ee5849f09a13cd8ee8b3c0cfd913199ee0ec Mon Sep 17 00:00:00 2001 From: Sebastiaan Pasma Date: Fri, 13 Jul 2018 14:54:26 +0200 Subject: [PATCH 31/44] wallet empty/no wallet fixes --- src/js/controllers/tab-send.js | 5 ++++- www/views/tab-send.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 3c73c229c..2ddad8dad 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -116,10 +116,13 @@ angular.module('copayApp.controllers').controller('tabSendController', function( }; var hasWallets = function() { - $scope.wallets = profileService.getWallets({ + $scope.walletsWithFunds = profileService.getWallets({ onlyComplete: true, hasFunds: true }); + $scope.wallets = profileService.getWallets({ + onlyComplete: true, + }); $scope.walletsBch = profileService.getWallets({ onlyComplete: true, coin: 'bch' diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 6bd32398d..05230af06 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -108,7 +108,7 @@ Date: Mon, 16 Jul 2018 14:20:40 +0900 Subject: [PATCH 32/44] 474 - Fix os in the link --- src/js/services/bitcoincomService.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/js/services/bitcoincomService.js b/src/js/services/bitcoincomService.js index d7883b68e..b404031b1 100644 --- a/src/js/services/bitcoincomService.js +++ b/src/js/services/bitcoincomService.js @@ -1,12 +1,13 @@ 'use strict'; -angular.module('copayApp.services').factory('bitcoincomService', function($http, $log, lodash, moment, storageService, configService, platformInfo, nextStepsService, homeIntegrationsService) { +angular.module('copayApp.services').factory('bitcoincomService', function(platformInfo, nextStepsService) { var root = {}; var credentials = {}; /* * Development: 'testnet' * Production: 'livenet' - */ + */ + var os = platformInfo.isAndroid ? 'android' : platformInfo.isIOS ? 'ios' : 'desktop'; credentials.NETWORK = 'livenet'; //credentials.NETWORK = 'testnet'; @@ -20,28 +21,28 @@ angular.module('copayApp.services').factory('bitcoincomService', function($http, name: 'games', title: 'Bitcoin Cash Games', icon: 'icon-games', - href: 'https://cashgames.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=CashGames' + href: 'https://cashgames.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=CashGames' }; var newsItem = { name: 'news', title: 'News', icon: 'icon-news', - href: 'https://news.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=News' + href: 'https://news.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=News' }; var poolItem = { name: 'pool', title: 'Mining Pool', icon: 'icon-mining', - href: 'https://pool.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=Pool' + href: 'https://pool.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=Pool' }; var toolsItem = { name: 'tools', title: 'Tools', icon: 'icon-tools', - href: 'https://tools.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=Tools' + href: 'https://tools.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=Tools' }; var priceChartItem = { @@ -55,7 +56,7 @@ angular.module('copayApp.services').factory('bitcoincomService', function($http, name: 'faucet', title: 'Free Bitcoin Cash', icon: 'icon-faucet', - href: 'https://free.bitcoin.com/?utm_source=WalletApp&utm_medium=iOS&utm_campaign=Faucet' + href: 'https://free.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=Faucet' }; var _getBitPay = function(endpoint) { From ea3cee4ebfe5bb7b3c8b09fd7c8e7f6c28714977 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Mon, 16 Jul 2018 14:40:02 +0900 Subject: [PATCH 33/44] 474 - Fix link --- src/js/controllers/buyBitcoindotcom.js | 4 +++- www/views/buyBitcoindotcom.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/buyBitcoindotcom.js b/src/js/controllers/buyBitcoindotcom.js index 741898c34..64766eede 100644 --- a/src/js/controllers/buyBitcoindotcom.js +++ b/src/js/controllers/buyBitcoindotcom.js @@ -1,7 +1,9 @@ 'use strict'; angular.module('copayApp.controllers').controller('buyBitcoindotcomController', - function($scope, $timeout, $ionicModal, $log, $state, $ionicHistory, lodash, bitcoincomService, externalLinkService, popupService) { + function($scope, platformInfo, externalLinkService) { + + $scope.os = platformInfo.isAndroid ? 'android' : platformInfo.isIOS ? 'ios' : 'desktop'; $scope.openExternalLink = function(url) { externalLinkService.open(url); diff --git a/www/views/buyBitcoindotcom.html b/www/views/buyBitcoindotcom.html index a8a7889e3..f0f8e27e3 100644 --- a/www/views/buyBitcoindotcom.html +++ b/www/views/buyBitcoindotcom.html @@ -15,7 +15,7 @@
- +
From 85e910dc467bc1d408b481fdd8fb0c63057e5b84 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Mon, 16 Jul 2018 17:55:21 +1200 Subject: [PATCH 34/44] Make the Cash Games link work again. --- src/js/services/bitcoincomService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/bitcoincomService.js b/src/js/services/bitcoincomService.js index b404031b1..051123111 100644 --- a/src/js/services/bitcoincomService.js +++ b/src/js/services/bitcoincomService.js @@ -21,7 +21,7 @@ angular.module('copayApp.services').factory('bitcoincomService', function(platfo name: 'games', title: 'Bitcoin Cash Games', icon: 'icon-games', - href: 'https://cashgames.bitcoin.com/?utm_source=WalletApp&utm_medium=' + os + '&utm_campaign=CashGames' + href: 'https://cashgames.bitcoin.com' }; var newsItem = { From a4f0f887660e720c859bf470024b02df181abfa8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Mon, 16 Jul 2018 15:52:33 +0900 Subject: [PATCH 35/44] Fix addressbookAdd --- src/js/controllers/addressbookAdd.js | 2 +- src/js/controllers/tab-send.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/addressbookAdd.js b/src/js/controllers/addressbookAdd.js index dcdb43b9f..9529d943e 100644 --- a/src/js/controllers/addressbookAdd.js +++ b/src/js/controllers/addressbookAdd.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('addressbookAddController', function($scope, $state, $stateParams, $timeout, $ionicHistory, gettextCatalog, addressbookService, popupService, configService, bitcoinCashJsService) { +angular.module('copayApp.controllers').controller('addressbookAddController', function($scope, $state, $stateParams, $timeout, $ionicHistory, gettextCatalog, addressbookService, popupService, configService, bitcoinCashJsService, platformInfo) { var config = configService.getSync(); var defaults = configService.getDefaults(); diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 2ddad8dad..2bfbee665 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -8,11 +8,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $scope.walletSelectorTitleForce = true; $scope.addContact = function() { - $state.go('tabs.settings').then(function() { - $state.go('tabs.addressbook').then(function() { - $state.go('tabs.addressbook.add'); - }); - }); + $state.go('tabs.send.addressbook'); }; $scope.pasteClipboard = function() { From 7fa1cd166845477fbc1c01738a3b916a6e2aeafb Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 11:02:25 +0900 Subject: [PATCH 36/44] Fix contacts --- src/js/controllers/tab-send.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 2bfbee665..671c0a91a 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -15,9 +15,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( if ($scope.clipboardHasAddress || $scope.clipboardHasContent) { clipboardService.readFromClipboard(function(text) { $scope.$apply(function() { - $scope.formData.search = text; + $scope.formData.search = text; + $scope.findContact($scope.formData.search); }); - $scope.findContact($scope.formData.search); }); } else { $ionicPopup.alert({ From 7459fcffd20f0951fabd90ff74fa69b733f9c236 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 13:43:47 +0900 Subject: [PATCH 37/44] 416 - Fix : Show the menu only if we are on the scan tab. --- src/js/services/incomingData.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/services/incomingData.js b/src/js/services/incomingData.js index a318e1157..1bb87b49c 100644 --- a/src/js/services/incomingData.js +++ b/src/js/services/incomingData.js @@ -228,10 +228,12 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat } else if (/^https?:\/\//.test(data)) { payproService.getPayProDetails(data, coin, function(err, details) { if (err) { - root.showMenu({ - data: data, - type: 'url' - }); + if ($state.includes('tabs.scan')) { + root.showMenu({ + data: data, + type: 'url' + }); + } return; } handlePayPro(details); From 8a7aeefc1c2bfc667129a3a2441ee055c98a2fde Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 14:20:06 +0900 Subject: [PATCH 38/44] Fix multiple selections --- www/views/tab-send.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/www/views/tab-send.html b/www/views/tab-send.html index 05230af06..8b39808db 100644 --- a/www/views/tab-send.html +++ b/www/views/tab-send.html @@ -115,7 +115,7 @@ wallet-selector-display-balance-as-fiat="displayBalanceAsFiat"> - From 6e8ec0b295b845c798d4b772dbd4c9a44a7e3daa Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 14:20:45 +0900 Subject: [PATCH 39/44] Add a loading popup --- src/js/controllers/tab-send.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 671c0a91a..cdfe48657 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, ongoingProcess, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; var originalList; @@ -70,7 +70,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } $scope.walletSelectorTitleTo = gettextCatalog.getString('Send to'); } else { + ongoingProcess.set(null, true); walletService.getAddress(wallet, true, function(err, addr) { + ongoingProcess.set(null, false); return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, recipientType: 'wallet', From b181854ca400119364858825e6496d53e96f7b45 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 14:40:43 +0900 Subject: [PATCH 40/44] 416 - ionicLoading --- src/js/controllers/tab-send.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index cdfe48657..da9414d05 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, ongoingProcess, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { +angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, $ionicLoading, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicPopup, $ionicNavBarDelegate, clipboardService) { var clipboardHasAddress = false; var clipboardHasContent = false; var originalList; @@ -70,9 +70,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } $scope.walletSelectorTitleTo = gettextCatalog.getString('Send to'); } else { - ongoingProcess.set(null, true); + $ionicLoading.show(); walletService.getAddress(wallet, true, function(err, addr) { - ongoingProcess.set(null, false); + $ionicLoading.hide(); return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, recipientType: 'wallet', From 255e3b85bb2aa5a8a27c46c06e561c45d440c90c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 16:01:37 +0900 Subject: [PATCH 41/44] Fix wallet from --- src/js/controllers/amount.js | 8 ++++++-- src/js/controllers/tab-send.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index f10121ee6..c54145947 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -38,9 +38,11 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.minShapeshiftAmount = parseFloat(data.stateParams.minShapeshiftAmount); $scope.maxShapeshiftAmount = parseFloat(data.stateParams.maxShapeshiftAmount); $scope.shapeshiftOrderId = data.stateParams.shapeshiftOrderId; - $scope.fromWalletId = data.stateParams.fromWalletId; } + // To get the wallet from with the new flow + $scope.fromWalletId = data.stateParams.fromWalletId; + if (data.stateParams.noPrefix) { $scope.showWarningMessage = data.stateParams.noPrefix != 0; if ($scope.showWarningMessage) { @@ -458,7 +460,8 @@ angular.module('copayApp.controllers').controller('amountController', function($ amount: $scope.useSendMax ? null : _amount, currency: unit.id.toUpperCase(), coin: coin, - useSendMax: $scope.useSendMax + useSendMax: $scope.useSendMax, + fromWalletId: $scope.fromWalletId || undefined }); } else { var amount = _amount; @@ -479,6 +482,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ toColor: $scope.toColor, coin: coin, useSendMax: $scope.useSendMax, + fromWalletId: $scope.fromWalletId || undefined }; if ($scope.shapeshiftOrderId) { diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index da9414d05..99265457d 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( return $state.transitionTo('tabs.send.amount', { displayAddress: $scope.walletToWalletFrom.coin === 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr, recipientType: 'wallet', - fromWalletId: $scope.walletToWalletFrom.walletId, + fromWalletId: $scope.walletToWalletFrom.id, toAddress: addr, coin: $scope.walletToWalletFrom.coin }); From 90fbf801d38dfde2e97dff2d3fa9f5fa9c64d75a Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Tue, 17 Jul 2018 19:10:33 +1200 Subject: [PATCH 42/44] Removed unnecessary logic. --- src/js/controllers/amount.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index c54145947..52695e829 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -461,7 +461,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ currency: unit.id.toUpperCase(), coin: coin, useSendMax: $scope.useSendMax, - fromWalletId: $scope.fromWalletId || undefined + fromWalletId: $scope.fromWalletId }); } else { var amount = _amount; @@ -482,7 +482,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ toColor: $scope.toColor, coin: coin, useSendMax: $scope.useSendMax, - fromWalletId: $scope.fromWalletId || undefined + fromWalletId: $scope.fromWalletId }; if ($scope.shapeshiftOrderId) { From 9b630547a2f6cc4628f431d032f3e3ae460a7ba8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 17:28:15 +0900 Subject: [PATCH 43/44] Incremente version --- app-template/bitcoincom/appConfig.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app-template/bitcoincom/appConfig.json b/app-template/bitcoincom/appConfig.json index 28e24e9fb..fefcb9a4f 100644 --- a/app-template/bitcoincom/appConfig.json +++ b/app-template/bitcoincom/appConfig.json @@ -24,9 +24,9 @@ "windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c", "pushSenderId": "1036948132229", "description": "A Secure Bitcoin Wallet", - "version": "4.12.2", - "fullVersion": "4.12-rc3", - "androidVersion": "412200", + "version": "4.13.0", + "fullVersion": "4.13-rc1", + "androidVersion": "413000", "_extraCSS": "", "_enabledExtensions": { "coinbase": false, From e18e446eef72090cb2bc1693ebb074f9c66ce12b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 17 Jul 2018 18:37:46 +0900 Subject: [PATCH 44/44] => Unsupported uglify --- src/js/services/clipboardService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/services/clipboardService.js b/src/js/services/clipboardService.js index ff28cd2e7..ebd30c28c 100644 --- a/src/js/services/clipboardService.js +++ b/src/js/services/clipboardService.js @@ -29,10 +29,10 @@ angular.module('copayApp.services').factory('clipboardService', function ($http, cb(nodeWebkitService.readFromClipboard()); } else { navigator.clipboard.readText() - .then(text => { + .then(function (text) { cb(text); }) - .catch(err => { + .catch(function (err) { $log.debug("Clipboard reading is not supported in browser.."); });