From 120efd8d820ee1c76ca4c9504292d8101e721711 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 1 Sep 2014 17:13:51 -0700 Subject: Fix up transactions UI --- public/css/calculator.less | 2 +- public/js/calculator.coffee | 2 ++ public/js/report.coffee | 6 +++--- routes/transactions.js | 2 +- src/routes/transactions.coffee | 2 +- views/users/edit.html | 5 +++-- views/users/show.html | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/public/css/calculator.less b/public/css/calculator.less index 6444c827..23b729d2 100644 --- a/public/css/calculator.less +++ b/public/css/calculator.less @@ -33,7 +33,7 @@ div.container-fluid { div#calculator { #exchange, #amount { width: 5em; } - span.btn { font-size: 16px; width: 100%; } + #received { font-size: 16px; width: 100%; } strong#total { font-size: 30px; } p#address { padding-top: 10px; } #title { display: none; } diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index fd5244c6..c4b5f6d3 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -41,6 +41,8 @@ $(-> $(this).val('') updateTotal() ) + + $('#received').click(-> window.location = "/#{g.user.username}/report") ) setup = -> diff --git a/public/js/report.coffee b/public/js/report.coffee index 7989c211..ed0cb232 100644 --- a/public/js/report.coffee +++ b/public/js/report.coffee @@ -86,7 +86,7 @@ display = (transactions) -> $('#modal').modal() $('#modal textarea').val('') - $('#modal .btn-primary').toggle(address?) + $('#modal .btn-primary').toggle(txid? and txid.length > 5) $('#modal .btn-danger').off().click(-> $('#yousure, #confirm').show() @@ -96,11 +96,11 @@ display = (transactions) -> $('#confirm .btn-danger').click(-> $.ajax(type: 'delete', url: "/#{$('#user').val()}/transactions/#{txid}") $('#modal').modal('hide') - row.remove() + row.fadeOut('slow') ) $('#modal .btn-primary').off().click(-> - window.open("https://blockchain.info/address/#{address}", '_blank') + window.open("https://blockchain.info/tx/#{txid}", '_blank') $('#modal').modal('hide') ) diff --git a/routes/transactions.js b/routes/transactions.js index 171163bc..ed45cbf0 100644 --- a/routes/transactions.js +++ b/routes/transactions.js @@ -28,7 +28,7 @@ txid = function() { var x; x = transactions[i++]; - if (typeof x !== "number") { + if (isNaN(parseInt(x))) { return x; } return user + ":transactions:" + x; diff --git a/src/routes/transactions.coffee b/src/routes/transactions.coffee index 8163748a..831baeaf 100644 --- a/src/routes/transactions.coffee +++ b/src/routes/transactions.coffee @@ -17,7 +17,7 @@ module.exports = db.lrange("#{user}:transactions", 0, -1, (err, transactions) -> txid = -> x = transactions[i++] - return x if typeof x != "number" + return x if isNaN(parseInt(x)) return user + ":transactions:" + x cb = (err, t) -> diff --git a/views/users/edit.html b/views/users/edit.html index 46d52df4..dda4fef4 100644 --- a/views/users/edit.html +++ b/views/users/edit.html @@ -82,7 +82,8 @@

In Bitcoin parlance, an extended key, also known as a BIP32 or HD Wallet key, is a master key that can be used to derive multiple bitcoin addresses.

The public portion of the key will be stored and used by CoinOS to generate a separate receiving address for every payment to your account. This will preserve your and your customers' privacy by preventing people from seeing or tracking transactions to your account other than their own.

-

The private portion of the key will be generated here but we will not store it after you close this window. You will be responsible for saving it and making copies of it. If you lose access to it, any funds sent to your account will be unspendable. If someone other than you gains access to it, your funds could be stolen.

+

The private portion of the key will be generated here but will not be stored after you close this window. You will be responsible for saving it and making copies of it. If you lose it, any funds sent to your account will be unspendable.

+

We'll ask you to encrypt the key with a password of your choosing. It's a good idea to choose a strong password and keep it written down and backed up seoarately from the key itself. You and any would-be attackers will need access to both the encrypted private key and the password that was used to encrypt it in order to spend funds received.

@@ -116,7 +117,7 @@
- I'm confident that no one but me will ever gain access to any of the copies of it by breaking into my computer or email account or through physical theft or extortion. I will always have access to at least one copy of the key even in case of hardware failure, natural disaster or memory lapse. + I'm confident that no one but me will ever gain access to any of the copies of it by breaking into my computer or email account or through physical theft or extortion and that I will always have access to at least one copy of the key even in case of hardware failure, natural disaster or memory lapse.
diff --git a/views/users/show.html b/views/users/show.html index b7d11bf8..e852f16a 100644 --- a/views/users/show.html +++ b/views/users/show.html @@ -49,7 +49,7 @@

- Payment Received. Thank you! +