From 96c1c1a29325c921e2a53052f4ff39c2a61ed145 Mon Sep 17 00:00:00 2001 From: JDonadio Date: Mon, 16 Jan 2017 16:25:12 -0300 Subject: [PATCH] update slide text button --- src/js/controllers/confirm.js | 24 +++++++++++++++++ src/js/controllers/modals/txpDetails.js | 28 +++++++++++++++++--- www/views/confirm.html | 7 +++-- www/views/includes/slideToAccept.html | 34 ++++++++----------------- www/views/modals/txp-details.html | 7 +++-- 5 files changed, 65 insertions(+), 35 deletions(-) diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index f6264828a..1ee427e60 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -53,8 +53,30 @@ angular.module('copayApp.controllers').controller('confirmController', function( else $scope.network = (new bitcore.Address($scope.toAddress)).network.name; resetValues(); setwallets(); + applyButtonText(); }); + function applyButtonText(multisig) { + $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' '; + + if ($scope.paypro) { + $scope.buttonText += gettextCatalog.getString('to pay'); + return; + } + + if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) { + $scope.buttonText += gettextCatalog.getString('to complete'); + return; + } + + if (multisig) { + $scope.buttonText += gettextCatalog.getString('to accept'); + return; + } + + $scope.buttonText += gettextCatalog.getString('to send'); + }; + function setwallets() { $scope.wallets = profileService.getWallets({ onlyComplete: true, @@ -268,6 +290,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.getSendMaxInfo(); } else setWallet(wallet); + + applyButtonText(wallet.credentials.n > 1); }; $scope.showDescriptionPopup = function() { diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 692b21a6f..ee2904a43 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -19,15 +19,37 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi $scope.displayUnit = getDisplayUnit($scope.tx.amountStr); initActionList(); checkPaypro(); - } + applyButtonText(); + }; + + function applyButtonText(multisig) { + $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' '; + + if ($scope.paypro) { + $scope.buttonText += gettextCatalog.getString('to pay'); + return; + } + + if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) { + $scope.buttonText += gettextCatalog.getString('to complete'); + return; + } + + if (multisig) { + $scope.buttonText += gettextCatalog.getString('to accept'); + return; + } + + $scope.buttonText += gettextCatalog.getString('to send'); + }; function getDisplayAmount(amountStr) { return amountStr.split(' ')[0]; - } + }; function getDisplayUnit(amountStr) { return amountStr.split(' ')[1]; - } + }; function initActionList() { $scope.actionList = []; diff --git a/www/views/confirm.html b/www/views/confirm.html index 8ad43e6f2..9612e42dc 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -131,17 +131,16 @@ has-wallet-chosen="wallet" insufficient-funds="insufficientFunds" no-matching-wallet="noMatchingWallet"> - {{'Accept' | translate}} + {{buttonText}} - {{'Accept' | translate}} + {{buttonText}} -
+ ng-touchstart="onTouchstart($event)" + ng-touchmove="onTouchmove($event)" + ng-touchend="onTouchend($event)" + ng-mousedown="onTouchstart($event)" + ng-mousemove="onTouchmove($event)" + ng-mouseup="onTouchend($event)"> +
-
+
-
+
-
+
{{displaySendStatus}}
diff --git a/www/views/modals/txp-details.html b/www/views/modals/txp-details.html index f437cede2..a37cdc7b7 100644 --- a/www/views/modals/txp-details.html +++ b/www/views/modals/txp-details.html @@ -166,19 +166,18 @@ ng-if="tx.pendingForUs && canSign && !paymentExpired && hasClick" click-send-status="sendStatus" has-wallet-chosen="true"> - {{'Accept'| translate}} + {{buttonText}} - {{'Accept'| translate}} + {{buttonText}} + slide-success-on-confirm="onSuccessConfirm()"> {{'Payment Sent' | translate}}