From ce1ca3f597ef943d08341ed1a84e920ed7dd8362 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 20:10:03 -0300 Subject: [PATCH 1/6] disable swipe with mouse --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 9cb84ce9c..0ac3c11c1 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,7 @@ From 172759c7119c6d8cce5f8878d133ca090e168314 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 20:12:43 -0300 Subject: [PATCH 2/6] enable swipe for all devices with touch screen --- js/controllers/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/controllers/index.js b/js/controllers/index.js index 7374423b9..285506ee9 100644 --- a/js/controllers/index.js +++ b/js/controllers/index.js @@ -6,9 +6,7 @@ angular.module('copayApp.controllers').controller('IndexController', function($s }; $scope.swipe = function(invert) { - if (isCordova) { - go.swipe(invert); - } + go.swipe(invert); }; }); From 6329a61efbfd9c3f0a968f1d34e43830957d1529 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 20:22:29 -0300 Subject: [PATCH 3/6] add a red X when a transaction was rejected by me --- views/modals/tx-status.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/views/modals/tx-status.html b/views/modals/tx-status.html index af9b15d77..3e29c4fff 100644 --- a/views/modals/tx-status.html +++ b/views/modals/tx-status.html @@ -1,9 +1,12 @@
-
+
+
+ +
From 02e228ffe788a6e5039bd4c7aa6bd20535f3a1bc Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 21:14:56 -0300 Subject: [PATCH 4/6] sign and reject more friendly user --- js/controllers/homeWallet.js | 91 +++++++++++++++++------------------ views/modals/txp-details.html | 29 +++++++++-- 2 files changed, 68 insertions(+), 52 deletions(-) diff --git a/js/controllers/homeWallet.js b/js/controllers/homeWallet.js index d49cf6738..dd4e7e985 100644 --- a/js/controllers/homeWallet.js +++ b/js/controllers/homeWallet.js @@ -6,69 +6,66 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi var w = $rootScope.wallet; if (w.isShared()) $scope.copayers = w.getRegisteredPeerIds(); - }; + }; - $scope.sign = function(ntxid) { - var w = $rootScope.wallet; - $scope.loading = true; - $scope.error = $scope.success = null; - w.signAndSend(ntxid, function(err, id, status) { - $scope.loading = false; - - if (err) - $scope.error = err; - else - txStatus.notify(status); - }); - }; - - $scope.reject = function(ntxid) { - var w = $rootScope.wallet; - w.reject(ntxid, function(err, status) { - if (err) - $scope.error = err; - else - txStatus.notify(status); - }); - }; - - - $scope.broadcast = function(ntxid) { - var w = $rootScope.wallet; - $scope.error = $scope.success = null; - $scope.loading = true; - w.issueTx(ntxid, function(err, txid, status) { - $scope.loading = false; - - if (err) - $scope.error = err; - - txStatus.notify(status); - }); - }; - - - var $outScope = $scope; $scope.openTxModal = function(tx) { var ModalInstanceCtrl = function($scope, $modalInstance) { + var w = $rootScope.wallet; $scope.tx = tx; + $scope.loading = null; + $scope.sign = function(ntxid) { - $outScope.sign(ntxid); - $modalInstance.dismiss('cancel'); + $scope.loading = true; + $timeout(function() { + w.signAndSend(ntxid, function(err, id, status) { + $scope.loading = false; + if (err) + $scope.error = err; + else + $modalInstance.close(status); + }); + }, 100); }; + $scope.reject = function(ntxid) { - $outScope.reject(ntxid); - $modalInstance.dismiss('cancel'); + $scope.loading = true; + $timeout(function() { + w.reject(ntxid, function(err, status) { + $scope.loading = false; + if (err) + $scope.error = err; + else + $modalInstance.close(status); + }); + }, 100); }; + + $scope.broadcast = function(ntxid) { + $scope.loading = true; + $timeout(function() { + w.issueTx(ntxid, function(err, txid, status) { + $scope.loading = false; + if (err) + $scope.error = err; + $modalInstance.close(status); + }); + }, 100); + }; + $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; }; - $modal.open({ + var modalInstance = $modal.open({ templateUrl: 'views/modals/txp-details.html', windowClass: 'medium', controller: ModalInstanceCtrl, }); + + modalInstance.result.then(function(status) { + txStatus.notify(status); + }); + }; }); diff --git a/views/modals/txp-details.html b/views/modals/txp-details.html index e79222faf..f7be43a79 100644 --- a/views/modals/txp-details.html +++ b/views/modals/txp-details.html @@ -58,16 +58,35 @@
+
-
+
+
+ +
+ + {{error}} + + × +
+ +
-
-
From 7340b4af29f56746de4e8c3ca515695077864c2a Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 21:17:49 -0300 Subject: [PATCH 5/6] loading after click on send button --- js/controllers/send.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/js/controllers/send.js b/js/controllers/send.js index d9cfb9b7f..82b278b25 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -145,26 +145,29 @@ angular.module('copayApp.controllers').controller('SendController', } $scope.loading = true; - var comment = form.comment.$modelValue; - var merchantData = $scope._merchantData; - var address, amount; - if (!merchantData) { - address = form.address.$modelValue; - amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0)); - } - w.spend({ - merchantData: merchantData, - toAddress: address, - amountSat: amount, - comment: comment, - }, function(err, txid, status) { - $scope.loading = false; - if (err) + $timeout(function() { + var comment = form.comment.$modelValue; + var merchantData = $scope._merchantData; + var address, amount; + if (!merchantData) { + address = form.address.$modelValue; + amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0)); + } + + w.spend({ + merchantData: merchantData, + toAddress: address, + amountSat: amount, + comment: comment, + }, function(err, txid, status) { + $scope.loading = false; + if (err) return $scope.setError(err); txStatus.notify(status); $scope.resetForm(); - }); + }); + }, 100); }; // QR code Scanner From c15ec586436f8858320e5563fd425b0b65c87186 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 11 Dec 2014 21:26:35 -0300 Subject: [PATCH 6/6] rollback --- js/controllers/send.js | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/js/controllers/send.js b/js/controllers/send.js index 82b278b25..d9cfb9b7f 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -145,29 +145,26 @@ angular.module('copayApp.controllers').controller('SendController', } $scope.loading = true; + var comment = form.comment.$modelValue; + var merchantData = $scope._merchantData; + var address, amount; + if (!merchantData) { + address = form.address.$modelValue; + amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0)); + } - $timeout(function() { - var comment = form.comment.$modelValue; - var merchantData = $scope._merchantData; - var address, amount; - if (!merchantData) { - address = form.address.$modelValue; - amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0)); - } - - w.spend({ - merchantData: merchantData, - toAddress: address, - amountSat: amount, - comment: comment, - }, function(err, txid, status) { - $scope.loading = false; - if (err) + w.spend({ + merchantData: merchantData, + toAddress: address, + amountSat: amount, + comment: comment, + }, function(err, txid, status) { + $scope.loading = false; + if (err) return $scope.setError(err); txStatus.notify(status); $scope.resetForm(); - }); - }, 100); + }); }; // QR code Scanner