From e349e6cad34a6109cecc498cb5a0d425d9cc5e65 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Wed, 5 Feb 2014 17:39:00 -0300 Subject: [PATCH 01/17] commented code for store tx with p2p --- lib/Sync.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Sync.js b/lib/Sync.js index d46e818..5d7d744 100644 --- a/lib/Sync.js +++ b/lib/Sync.js @@ -125,13 +125,15 @@ console.log('[Sync.js.109] WARN: Reach reog depth limit'); //TODO Sync.prototype.storeTxs = function(txs, cb) { var self = this; - // TODO + // TODO -- Peertopeer + /* self.txDb.createFromTxs(txs, function(err, inserted_txs, updated_addrs) { if (err) return cb(err); self._handleBroadcast(null, inserted_txs, updated_addrs); return cb(err); }); + */ }; return Sync; } From f2dfacc25ae6d067f23a851145f468a227fca7e5 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Wed, 5 Feb 2014 18:30:58 -0300 Subject: [PATCH 02/17] update generi favicon --- public/img/icons/favicon.ico | Bin 1406 -> 318 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/img/icons/favicon.ico b/public/img/icons/favicon.ico index 93d134936aa05abaea161a71f93b570d932593cf..7e25304f684c2d692ec8785953e2c6f9f9268fb3 100644 GIT binary patch literal 318 ucmZQzU<5(|0RbS%!l1#(z#zuJz@P!d0zj+)#2|4HXaJKC0wgyI7#IMP3ISvQ literal 1406 zcmZQzU<5(|0R}M0U}azs1F|%L7$l?s#Ec9aKoZP=&}i(p?>{o!Javd+_tKdR6XvgE z*t7o-!?dYW87^MG!_d?}lVQ@r)eHw#%w#xm;VMHfFFo-F$ zDJTkoRIr280oC&`i^~ZMa!7GP_&^i6#KpOkMHpnHq?AC;Vv+-vcueF4)&Ktt3?TfY b9#U4qOlbfz4nQ%C{Qy{?e%udH57P$#M%iQ_ From afec67972052a627c93c08fb314ed17f6e26ef9e Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Thu, 6 Feb 2014 04:46:50 -0300 Subject: [PATCH 03/17] added the style improvement for the currency switch --- app/controllers/currency.js | 5 ----- public/css/common.css | 3 +-- public/js/controllers/footer.js | 2 +- public/js/controllers/header.js | 4 +++- public/views/includes/footer.html | 10 ++++++---- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/app/controllers/currency.js b/app/controllers/currency.js index e635a7b..9642e97 100644 --- a/app/controllers/currency.js +++ b/app/controllers/currency.js @@ -40,11 +40,6 @@ exports.index = function(req, res) { // Init var currentTime = +new Date(); - console.log('-----------------------------------'); - console.log(timestamp); - console.log(currentTime); - console.log(currentTime >= (timestamp + delay)); - console.log('-----------------------------------'); if (bitstampRate === 0 || currentTime >= (timestamp + delay)) { timestamp = currentTime; diff --git a/public/css/common.css b/public/css/common.css index f84e5a6..81eda36 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -277,8 +277,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { height: 51px; overflow: hidden; } - -#footer .currency a:active { +#footer .currency a.active { color: #fff; text-decoration: underline; } diff --git a/public/js/controllers/footer.js b/public/js/controllers/footer.js index 8ad61ab..64c0f2d 100644 --- a/public/js/controllers/footer.js +++ b/public/js/controllers/footer.js @@ -39,7 +39,7 @@ angular.module('insight.system').controller('FooterController', $scope.setCurrency = function(currency) { if (currency === 'USD') { Currency.get({}, function(res) { - $rootScope.currency.factor = res.data.bitstamp; + $rootScope.currency.factor = $rootScope.currency.bitstamp = res.data.bitstamp; }); } else if (currency === 'mBTC') { $rootScope.currency.factor = 1000; diff --git a/public/js/controllers/header.js b/public/js/controllers/header.js index 25f2d0b..cf63deb 100755 --- a/public/js/controllers/header.js +++ b/public/js/controllers/header.js @@ -4,7 +4,9 @@ angular.module('insight.system').controller('HeaderController', function($scope, $rootScope, getSocket, Global, Block, Currency) { $scope.global = Global; - Currency.get(); + Currency.get({}, function(res) { + $rootScope.currency.bitstamp = res.data.bitstamp; + }); $scope.menu = [ { diff --git a/public/views/includes/footer.html b/public/views/includes/footer.html index 5395a66..080adb5 100644 --- a/public/views/includes/footer.html +++ b/public/views/includes/footer.html @@ -1,9 +1,11 @@
- Currency: - USD - - BTC - - mBTC + + Currency: + USD · + BTC · + mBTC +
Insight API v{{version}}
From 5e4b014c54356ee3b15fed776203165e66924080 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 6 Feb 2014 12:53:39 -0300 Subject: [PATCH 04/17] added blockhash to tx list. fix lookandfeel tx list, responsive support. hide link copy/paste for small devicas --- public/css/common.css | 13 +++++++++++- public/views/address.html | 2 +- public/views/block.html | 2 +- public/views/transaction.html | 6 +++--- public/views/transaction/tx.html | 35 ++++++++++++++++++++++++-------- 5 files changed, 43 insertions(+), 15 deletions(-) diff --git a/public/css/common.css b/public/css/common.css index 81eda36..8700862 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -231,6 +231,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { margin: 20px 0 10px; overflow: hidden; padding: 15px; + border: 1px solid #ccc; } .btn { @@ -302,7 +303,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { .line-mid { padding: 15px 0;} .line-top { border-top: 1px solid #EAEAEA; - padding: 15px 0; + padding: 15px 0 0 0; } /* Custom page CSS @@ -413,6 +414,16 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { .btn-copy { margin-left: 5px; } .btn-expand { margin-right: 5px; } +@media (max-width: 991px) { + .btn-copy { + display: none; + } +} + +.txid { + line-height: 26px; +} + .transaction-vin-vout .ellipsis { margin-bottom: 10px; } .transaction-vin-vout .btc-value { margin-left: 15px; } diff --git a/public/views/address.html b/public/views/address.html index 76c06ff..9c1fbb2 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -6,7 +6,7 @@ diff --git a/public/views/block.html b/public/views/block.html index 53e4aae..178b8cc 100644 --- a/public/views/block.html +++ b/public/views/block.html @@ -9,7 +9,7 @@

Block #{{ block.height }}

diff --git a/public/views/transaction.html b/public/views/transaction.html index abb4533..d3425c8 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -9,7 +9,7 @@
-
+

Summary

@@ -25,8 +25,8 @@
Block - - {{tx.blockhash}} + + {{tx.blockhash}}
diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 0b7062e..d1a3f03 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -1,10 +1,16 @@ -
- - - {{tx.txid}} - +
+
+ + +
-
+
+ +
+
+
@@ -92,9 +98,20 @@
-
- Fees: {{tx.fees}} -
+
+
+ + BlockHash + {{tx.blockhash}} + + +
+
+
+
+ +
+
From c5fbde45bb2511d42ba79a0e698c04033d1bc150 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Thu, 6 Feb 2014 12:57:15 -0300 Subject: [PATCH 05/17] added a tooltip when copy&paste buttons is pressed --- .gitignore | 1 + app/views/includes/foot.jade | 16 ++++++++-------- public/css/common.css | 8 ++++++++ public/js/directives.js | 4 ++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index aabec27..7321330 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,5 @@ npm-debug.log .DS_Store public/lib/* +db/* diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index 323f372..4e9a987 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -1,21 +1,21 @@ #footer(data-ng-include="'/views/includes/footer.html'", role='navigation') script(type='text/javascript', src='/socket.io/socket.io.js') -script(type='text/javascript', src='/lib/momentjs/moment.js') +script(type='text/javascript', src='/lib/momentjs/min/moment.min.js') script(type='text/javascript', src='/lib/qrcode-generator/js/qrcode.js') script(type='text/javascript', src='/lib/zeroclipboard/ZeroClipboard.min.js') //AngularJS -script(type='text/javascript', src='/lib/angular/angular.js') -script(type='text/javascript', src='/lib/angular-resource/angular-resource.js') -script(type='text/javascript', src='/lib/angular-route/angular-route.js') +script(type='text/javascript', src='/lib/angular/angular.min.js') +script(type='text/javascript', src='/lib/angular-resource/angular-resource.min.js') +script(type='text/javascript', src='/lib/angular-route/angular-route.min.js') script(type='text/javascript', src='/lib/angular-qrcode/qrcode.js') -script(type='text/javascript', src='/lib/angular-animate/angular-animate.js') +script(type='text/javascript', src='/lib/angular-animate/angular-animate.min.js') //Angular UI -script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap.js') -script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap-tpls.js') -script(type='text/javascript', src='/lib/angular-ui-utils/ui-utils.js') +script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap.min.js') +script(type='text/javascript', src='/lib/angular-bootstrap/ui-bootstrap-tpls.min.js') +script(type='text/javascript', src='/lib/angular-ui-utils/ui-utils.min.js') //Application Init script(type='text/javascript', src='/js/app.js') diff --git a/public/css/common.css b/public/css/common.css index 81eda36..8e9164d 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -411,6 +411,14 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { width: 30px; } .btn-copy { margin-left: 5px; } +.btn-copy .tooltip { + display: inline-block; + margin-left: 10px; + margin-top: -2px; + opacity: 0; +} +.btn-copy.zeroclipboard-is-hover { color: #2a6496; } +.btn-copy.zeroclipboard-is-active .tooltip { opacity: 1; } .btn-expand { margin-right: 5px; } .transaction-vin-vout .ellipsis { margin-bottom: 10px; } diff --git a/public/js/directives.js b/public/js/directives.js index 2d90b27..ed0b1cf 100755 --- a/public/js/directives.js +++ b/public/js/directives.js @@ -39,6 +39,7 @@ angular.module('insight') return { restric: 'A', scope: { clipCopy: '=clipCopy' }, + template: '
Copied!
', link: function(scope, elm) { var clip = new ZeroClipboard(elm); @@ -48,6 +49,9 @@ angular.module('insight') }; client.on('mousedown', onMousedown); + client.on('noflash wrongflash', function() { + return elm.remove(); + }); scope.$on('$destroy', function() { client.off('mousedown', onMousedown); From 724c4911bcc613eb9a14b015d6216b305524a328 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Thu, 6 Feb 2014 13:57:11 -0300 Subject: [PATCH 06/17] fixed error message when bitcoind is down --- public/js/controllers/connection.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/controllers/connection.js b/public/js/controllers/connection.js index ae94e0e..b30850a 100644 --- a/public/js/controllers/connection.js +++ b/public/js/controllers/connection.js @@ -4,6 +4,7 @@ angular.module('insight.connection').controller('ConnectionController', function($scope, $window, Status, Sync, getSocket) { // Set initial values + $scope.apiOnline = true; $scope.serverOnline = true; $scope.clienteOnline = true; @@ -22,7 +23,7 @@ function($scope, $window, Status, Sync, getSocket) { $scope.getConnStatus = function() { Sync.get({}, function(sync) { - $scope.apiOnline = (sync.status !== 'aborted' && sync.status !== 'error') ? true : false; + $scope.apiOnline = (sync.status !== 'aborted' && sync.status !== 'error'); }, function() { $scope.apiOnline = false; @@ -31,7 +32,7 @@ function($scope, $window, Status, Sync, getSocket) { socket.emit('subscribe', 'sync'); socket.on('status', function(sync) { - $scope.apiOnline = (sync.status !== 'aborted' && sync.status !== 'error') ? true : false; + $scope.apiOnline = (sync.status !== 'aborted' && sync.status !== 'error'); }); // Check for the client conneciton From bdfc1c5455b76955c89da8801c380a99e477f6bf Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Thu, 6 Feb 2014 16:50:20 -0300 Subject: [PATCH 07/17] remover the fade effect in the transaction list --- public/js/controllers/transactions.js | 2 +- public/views/transaction/list.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/controllers/transactions.js b/public/js/controllers/transactions.js index 5d4da03..0107c56 100644 --- a/public/js/controllers/transactions.js +++ b/public/js/controllers/transactions.js @@ -75,7 +75,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans tx.voutSimple = _aggregateItems(tx.vout); }; - var _paginate = function (data) { + var _paginate = function(data) { $scope.loading = false; pagesTotal = data.pagesTotal; diff --git a/public/views/transaction/list.html b/public/views/transaction/list.html index 76bf5b4..ac81fd6 100644 --- a/public/views/transaction/list.html +++ b/public/views/transaction/list.html @@ -1,5 +1,5 @@
There are not transactions
-
+
From 0b3ac5804f7c5474b1aa73d07e136b1a196373b1 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 6 Feb 2014 17:46:14 -0300 Subject: [PATCH 08/17] tx page: fixed left column with icon and summary --- public/css/common.css | 37 ++++++++++--------- public/views/address.html | 8 ++--- public/views/block.html | 9 +++-- public/views/transaction.html | 68 +++++++++++++++++++---------------- 4 files changed, 66 insertions(+), 56 deletions(-) diff --git a/public/css/common.css b/public/css/common.css index f49f7c8..d323cb8 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -196,25 +196,24 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { .block-id { background-color: #373D42; border: 3px solid #FFFFFF; - height: 165px; - margin: 10px auto; + margin: 0 auto; width: 165px; + color: #fff; + text-align: center; + font-size: 80px; } -.block-id h1 { +.block-id span { + margin-top: 10px; +} + +.block-id h2 { color: #FFFFFF; font-weight: bold; line-height: 30px; - text-align: center; - font-size: 24px; -} - -.block-id h3 { - color: #FFFFFF; - font-weight: bold; - line-height: 30px; - text-align: center; font-size: 24px; + margin-top: 0; + margin-bottom: 10px; } .icon-block { @@ -432,12 +431,18 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { line-height: 26px; } +.tx-id { + background-color: #373D42; + border: 3px solid #FFFFFF; + margin: 0 auto; + width: 165px; + color: #FFFFFF; + font-size: 80px; + text-align: center; +} + .transaction-vin-vout .ellipsis { margin-bottom: 10px; } .transaction-vin-vout .btc-value { margin-left: 15px; } .page-header { margin-top: 0; } -.block_hash { - margin-left: 46px; - text-align: center; -} diff --git a/public/views/address.html b/public/views/address.html index 9c1fbb2..0f4822e 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -5,10 +5,10 @@

Address

+

Summary

diff --git a/public/views/block.html b/public/views/block.html index 178b8cc..7dca6b6 100644 --- a/public/views/block.html +++ b/public/views/block.html @@ -2,15 +2,14 @@
+

Block

-
- -
-

Block #{{ block.height }}

+ +

#{{ block.height }}

Hashes

diff --git a/public/views/transaction.html b/public/views/transaction.html index d3425c8..6f786dc 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -1,36 +1,43 @@
-

- Transaction - View information about a bitcoin transaction -

- -
-
-
- -
-
-

Summary

- - - - - - - - - - - - -
Size {{tx.size}} (bytes)
Received Time {{tx.time * 1000|date:'medium'}}
Block - - - {{tx.blockhash}} -
+
+
+

Transaction

+
+
-
+
+ + +
+

Summary

+ + + + + + + + + + + +
Size {{tx.size}} (bytes)
Received Time {{tx.time * 1000|date:'medium'}}
+
+ +
+

+ Details + View information about a bitcoin transaction +

+ +
+
+
+ +

Inputs and Outputs

@@ -49,7 +56,6 @@
-
From 4e49989d24c2377374d2741496f604f88425a2fb Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 6 Feb 2014 18:09:50 -0300 Subject: [PATCH 09/17] Currency support on address pages and missing places --- public/js/controllers/footer.js | 4 +--- public/views/address.html | 6 +++--- public/views/transaction.html | 6 +++--- public/views/transaction/tx.html | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/public/js/controllers/footer.js b/public/js/controllers/footer.js index 64c0f2d..28744bc 100644 --- a/public/js/controllers/footer.js +++ b/public/js/controllers/footer.js @@ -4,9 +4,7 @@ angular.module('insight.system').controller('FooterController', function($rootScope, $scope, Version, Currency) { var _roundFloat = function(x, n) { - if(!parseInt(n, 10)) n = 0; - - if(!parseFloat(x)) return false; + if(!parseInt(n, 10) || !parseFloat(x)) n = 0; return Math.round(x * Math.pow(10, n)) / Math.pow(10, n); }; diff --git a/public/views/address.html b/public/views/address.html index 0f4822e..9dfd80d 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -16,15 +16,15 @@ Total Received - {{address.totalReceived}} BTC + {{$root.currency.getConversion(address.totalReceived)}} Total Sent - {{address.totalSent}} BTC + {{$root.currency.getConversion(address.totalSent)}} Final Balance - {{address.balance}} BTC + {{$root.currency.getConversion(address.balance)}} No. Transactions diff --git a/public/views/transaction.html b/public/views/transaction.html index 6f786dc..3f83dd7 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -43,15 +43,15 @@ Total Input - {{tx.valueIn}} BTC + {{$root.currency.getConversion(tx.valueIn)}} Total Output - {{tx.valueOut}} BTC + {{$root.currency.getConversion(tx.valueOut)}} Fees - {{tx.fees}} BTC + {{$root.currency.getConversion(tx.fees)}} diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index d1a3f03..154dca2 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -109,7 +109,7 @@
- +
From b590cf5c5c3a99ff918387b0c879120a89168b4d Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 6 Feb 2014 18:25:12 -0300 Subject: [PATCH 10/17] currency links at left column on all pages --- public/css/common.css | 6 ++++-- public/views/address.html | 1 + public/views/block.html | 1 + public/views/includes/currency.html | 8 ++++++++ public/views/includes/footer.html | 8 -------- public/views/transaction.html | 1 + 6 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 public/views/includes/currency.html diff --git a/public/css/common.css b/public/css/common.css index d323cb8..f3e3b5e 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -277,9 +277,11 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { height: 51px; overflow: hidden; } -#footer .currency a.active { - color: #fff; + +.currency a.active { + color: #000; text-decoration: underline; + cursor: default; } #footer a.insight { diff --git a/public/views/address.html b/public/views/address.html index 9dfd80d..c6c8269 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -33,6 +33,7 @@
+
diff --git a/public/views/block.html b/public/views/block.html index 7dca6b6..07662f5 100644 --- a/public/views/block.html +++ b/public/views/block.html @@ -30,6 +30,7 @@
+
diff --git a/public/views/includes/currency.html b/public/views/includes/currency.html new file mode 100644 index 0000000..3dc3ef2 --- /dev/null +++ b/public/views/includes/currency.html @@ -0,0 +1,8 @@ +
+ + Currency: + USD · + BTC · + mBTC + +
diff --git a/public/views/includes/footer.html b/public/views/includes/footer.html index 080adb5..e87127e 100644 --- a/public/views/includes/footer.html +++ b/public/views/includes/footer.html @@ -1,11 +1,3 @@
-
- - Currency: - USD · - BTC · - mBTC - -
Insight API v{{version}}
diff --git a/public/views/transaction.html b/public/views/transaction.html index 3f83dd7..7873536 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -25,6 +25,7 @@ +
From 398babaa8f679173fdf9b8b03c50ddfd729f303f Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Fri, 7 Feb 2014 13:57:55 -0300 Subject: [PATCH 11/17] added new controller --- app/controllers/currency.js | 10 +---- app/views/includes/foot.jade | 3 +- public/js/controllers/currency.js | 57 +++++++++++++++++++++++++++++ public/js/controllers/footer.js | 47 +----------------------- public/js/controllers/header.js | 6 +-- public/views/address.html | 8 ++-- public/views/includes/currency.html | 8 ++-- public/views/transaction.html | 14 +++---- public/views/transaction/tx.html | 40 ++++++++++---------- 9 files changed, 97 insertions(+), 96 deletions(-) create mode 100644 public/js/controllers/currency.js diff --git a/app/controllers/currency.js b/app/controllers/currency.js index 9642e97..244ef32 100644 --- a/app/controllers/currency.js +++ b/app/controllers/currency.js @@ -48,19 +48,13 @@ exports.index = function(req, res) { res.jsonp({ status: 200, - data: { - bitstamp: bitstampRate, - delay: delay - } + data: { bitstamp: bitstampRate } }); }); } else { res.jsonp({ status: 200, - data: { - bitstamp: bitstampRate, - delay: delay - } + data: { bitstamp: bitstampRate } }); } }; diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index 4e9a987..23b6ce8 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -35,11 +35,12 @@ script(type='text/javascript', src='/js/services/currency.js') //Application Controllers script(type='text/javascript', src='/js/controllers/index.js') script(type='text/javascript', src='/js/controllers/header.js') +script(type='text/javascript', src='/js/controllers/search.js') script(type='text/javascript', src='/js/controllers/blocks.js') script(type='text/javascript', src='/js/controllers/transactions.js') script(type='text/javascript', src='/js/controllers/address.js') -script(type='text/javascript', src='/js/controllers/search.js') script(type='text/javascript', src='/js/controllers/status.js') script(type='text/javascript', src='/js/controllers/footer.js') script(type='text/javascript', src='/js/controllers/connection.js') +script(type='text/javascript', src='/js/controllers/currency.js') script(type='text/javascript', src='/js/init.js') diff --git a/public/js/controllers/currency.js b/public/js/controllers/currency.js new file mode 100644 index 0000000..bfbf593 --- /dev/null +++ b/public/js/controllers/currency.js @@ -0,0 +1,57 @@ +'use strict'; + +angular.module('insight.currency').controller('CurrencyController', + function($scope, $rootScope, Currency) { + + $rootScope.currency = { + factor: 1, + bitstamp: 0, + symbol: 'BTC' + }; + + var _roundFloat = function(x, n) { + if(!parseInt(n, 10) || !parseFloat(x)) n = 0; + + return Math.round(x * Math.pow(10, n)) / Math.pow(10, n); + }; + + $scope.setCurrency = function(currency) { + $rootScope.currency.symbol = currency; + + if (currency === 'USD') { + Currency.get({}, function(res) { + $rootScope.currency.factor = $rootScope.currency.bitstamp = res.data.bitstamp; + }); + } else if (currency === 'mBTC') { + $rootScope.currency.factor = 1000; + } else { + $rootScope.currency.factor = 1; + } + }; + + $scope.getConvertion = function(value) { + if (typeof value !== 'undefined' && value !== null) { + var response; + + if ($rootScope.currency.symbol === 'USD') { + response = _roundFloat((value * $rootScope.currency.factor), 2); + } else if ($rootScope.currency.symbol === 'mBTC') { + $rootScope.currency.factor = 1000; + response = _roundFloat((value * $rootScope.currency.factor), 5); + } else { + $rootScope.currency.factor = 1; + response = value; + } + + return response + ' ' + $rootScope.currency.symbol; + } + + return 'value error'; + }; + + // Get initial value + Currency.get({}, function(res) { + $rootScope.currency.bitstamp = res.data.bitstamp; + }); + + }); diff --git a/public/js/controllers/footer.js b/public/js/controllers/footer.js index 28744bc..047ba1e 100644 --- a/public/js/controllers/footer.js +++ b/public/js/controllers/footer.js @@ -1,52 +1,7 @@ 'use strict'; angular.module('insight.system').controller('FooterController', - function($rootScope, $scope, Version, Currency) { - - var _roundFloat = function(x, n) { - if(!parseInt(n, 10) || !parseFloat(x)) n = 0; - - return Math.round(x * Math.pow(10, n)) / Math.pow(10, n); - }; - - $rootScope.currency = { - factor: 1, - symbol: 'BTC', - bitstamp: 0, - getConversion: function(value) { - if (value !== 'undefined' && value !== null) { - var response; - - if (this.symbol === 'USD') { - response = _roundFloat((value * this.factor), 2); - } else if (this.symbol === 'mBTC') { - this.factor = 1000; - response = _roundFloat((value * this.factor), 5); - } else { - this.factor = 1; - response = value; - } - - return response + ' ' + this.symbol; - } - - return null; - } - }; - - $scope.setCurrency = function(currency) { - if (currency === 'USD') { - Currency.get({}, function(res) { - $rootScope.currency.factor = $rootScope.currency.bitstamp = res.data.bitstamp; - }); - } else if (currency === 'mBTC') { - $rootScope.currency.factor = 1000; - } else { - $rootScope.currency.factor = 1; - } - - $rootScope.currency.symbol = currency; - }; + function($scope, Version) { var _getVersion = function() { Version.get({}, diff --git a/public/js/controllers/header.js b/public/js/controllers/header.js index cf63deb..e5fa3ac 100755 --- a/public/js/controllers/header.js +++ b/public/js/controllers/header.js @@ -1,13 +1,9 @@ 'use strict'; angular.module('insight.system').controller('HeaderController', - function($scope, $rootScope, getSocket, Global, Block, Currency) { + function($scope, $rootScope, getSocket, Global, Block) { $scope.global = Global; - Currency.get({}, function(res) { - $rootScope.currency.bitstamp = res.data.bitstamp; - }); - $scope.menu = [ { 'title': 'Blocks', diff --git a/public/views/address.html b/public/views/address.html index c6c8269..a8d065c 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -12,19 +12,19 @@

Summary

- +
- + - + - + diff --git a/public/views/includes/currency.html b/public/views/includes/currency.html index 3dc3ef2..c9acb46 100644 --- a/public/views/includes/currency.html +++ b/public/views/includes/currency.html @@ -1,8 +1,8 @@ -
+
Currency: - USD · - BTC · - mBTC + USD · + BTC · + mBTC
diff --git a/public/views/transaction.html b/public/views/transaction.html index 7873536..71f4870 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -27,36 +27,32 @@
Total Received{{$root.currency.getConversion(address.totalReceived)}}{{getConvertion(address.totalReceived)}}
Total Sent{{$root.currency.getConversion(address.totalSent)}}{{getConvertion(address.totalSent)}}
Final Balance{{$root.currency.getConversion(address.balance)}}{{getConvertion(address.balance)}}
No. Transactions
-

- Details + Details View information about a bitcoin transaction

-
-

Inputs and Outputs

- +
- + - + - +
Total Input{{$root.currency.getConversion(tx.valueIn)}}{{getConvertion(tx.valueIn)}}
Total Output{{$root.currency.getConversion(tx.valueOut)}}{{getConvertion(tx.valueOut)}}
Fees{{$root.currency.getConversion(tx.fees)}}{{getConvertion(tx.fees)}}
- diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 154dca2..18d8595 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -1,20 +1,21 @@ -
-
- - -
- {{tx.txid}} +
+
+
+ + + +
+
+
-
- -
-
-
+
-
{{$root.currency.getConversion(vin.reward)}}
+
{{getConvertion(vin.reward)}}
No Inputs (Newly Generated Coins)
@@ -23,7 +24,7 @@
-
{{$root.currency.getConversion(vin.value)}}
+
{{getConvertion(vin.value)}}
{{vin.addr}} {{vin.addr}} @@ -33,7 +34,7 @@
-
{{$root.currency.getConversion(vin.value)}}
+
{{getConvertion(vin.value)}}
   {{vin.addr}} @@ -63,7 +64,7 @@
-
{{$root.currency.getConversion(vout.value)}}
+
{{getConvertion(vout.value)}}
{{vout.addr}} {{vout.addr}} @@ -73,7 +74,7 @@
-
{{$root.currency.getConversion(vout.value)}}
+
{{getConvertion(vout.value)}}
@@ -101,7 +102,7 @@
- BlockHash + BlockHash {{tx.blockhash}} @@ -109,11 +110,12 @@
- +
- +
+
From 2a4d3f025285894a90c643d514f803edd40faa92 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Fri, 7 Feb 2014 15:13:09 -0300 Subject: [PATCH 12/17] removed unnecessary CurrencyController calls --- public/js/controllers/currency.js | 41 +++--- public/views/address.html | 8 +- public/views/transaction.html | 8 +- public/views/transaction/tx.html | 204 +++++++++++++++--------------- 4 files changed, 129 insertions(+), 132 deletions(-) diff --git a/public/js/controllers/currency.js b/public/js/controllers/currency.js index bfbf593..e5c7c62 100644 --- a/public/js/controllers/currency.js +++ b/public/js/controllers/currency.js @@ -6,7 +6,26 @@ angular.module('insight.currency').controller('CurrencyController', $rootScope.currency = { factor: 1, bitstamp: 0, - symbol: 'BTC' + symbol: 'BTC', + getConvertion: function(value) { + if (typeof value !== 'undefined' && value !== null) { + var response; + + if (this.symbol === 'USD') { + response = _roundFloat((value * this.factor), 2); + } else if (this.symbol === 'mBTC') { + this.factor = 1000; + response = _roundFloat((value * this.factor), 5); + } else { + this.factor = 1; + response = value; + } + + return response + ' ' + this.symbol; + } + + return 'value error'; + } }; var _roundFloat = function(x, n) { @@ -29,26 +48,6 @@ angular.module('insight.currency').controller('CurrencyController', } }; - $scope.getConvertion = function(value) { - if (typeof value !== 'undefined' && value !== null) { - var response; - - if ($rootScope.currency.symbol === 'USD') { - response = _roundFloat((value * $rootScope.currency.factor), 2); - } else if ($rootScope.currency.symbol === 'mBTC') { - $rootScope.currency.factor = 1000; - response = _roundFloat((value * $rootScope.currency.factor), 5); - } else { - $rootScope.currency.factor = 1; - response = value; - } - - return response + ' ' + $rootScope.currency.symbol; - } - - return 'value error'; - }; - // Get initial value Currency.get({}, function(res) { $rootScope.currency.bitstamp = res.data.bitstamp; diff --git a/public/views/address.html b/public/views/address.html index a8d065c..4c5e9df 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -12,19 +12,19 @@

Summary

- +
- + - + - + diff --git a/public/views/transaction.html b/public/views/transaction.html index 71f4870..bcf0074 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -37,19 +37,19 @@

Inputs and Outputs

-
Total Received{{getConvertion(address.totalReceived)}}{{$root.currency.getConvertion(address.totalReceived)}}
Total Sent{{getConvertion(address.totalSent)}}{{$root.currency.getConvertion(address.totalSent)}}
Final Balance{{getConvertion(address.balance)}}{{$root.currency.getConvertion(address.balance)}}
No. Transactions
+
- + - + - +
Total Input{{getConvertion(tx.valueIn)}}{{$root.currency.getConvertion(tx.valueIn)}}
Total Output{{getConvertion(tx.valueOut)}}{{$root.currency.getConvertion(tx.valueOut)}}
Fees{{getConvertion(tx.fees)}}{{$root.currency.getConvertion(tx.fees)}}
diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 18d8595..2d6cce8 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -1,121 +1,119 @@ -
-
-
- - - -
-
- +
+
+ + +
-
-
-
-
-
{{getConvertion(vin.reward)}}
+
+ +
+
+
+
+
+
+
{{$root.currency.getConvertion(vin.reward)}}
+
+ No Inputs (Newly Generated Coins) +
+
+
+
+
+
+
{{$root.currency.getConvertion(vin.value)}}
- No Inputs (Newly Generated Coins) + {{vin.addr}} + {{vin.addr}} + {{vin.addr}}
-
-
-
-
{{getConvertion(vin.value)}}
-
- {{vin.addr}} - {{vin.addr}} - {{vin.addr}} -
+
+
+
{{$root.currency.getConvertion(vin.value)}}
+
+    + {{vin.addr}} + {{vin.addr}}
-
-
-
{{getConvertion(vin.value)}}
-
-    - {{vin.addr}} - {{vin.addr}} -
-
-
-
-
- - scriptSig - {{vin.scriptSig.asm}} - -
-
-
-
-
-
- - -
-
-
-
-
{{getConvertion(vout.value)}}
-
- {{vout.addr}} - {{vout.addr}} - {{address}} -
-
-
-
-
-
{{getConvertion(vout.value)}}
- -
-
-
-
- -

- Type - {{vout.scriptPubKey.type}} -

-

- scriptPubKey - {{vout.scriptPubKey.asm}} -

-
-
+
+
+
+ + scriptSig + {{vin.scriptSig.asm}} +
-
-
- - BlockHash - {{tx.blockhash}} - - -
+ -
-
- -
-
- - - + +
+
+
+
+
{{$root.currency.getConvertion(vout.value)}}
+
+ {{vout.addr}} + {{vout.addr}} + {{address}} +
+
+
+
+
+
{{$root.currency.getConvertion(vout.value)}}
+ +
+
+
+
+ +

+ Type + {{vout.scriptPubKey.type}} +

+

+ scriptPubKey + {{vout.scriptPubKey.asm}} +

+
+
+
+
+
+
+
+ + BlockHash + {{tx.blockhash}} + + +
+
+
+
+ +
+
+ + + +
+
From e540112b4b63f77c14898c9cc9e4f02aa6a69d2b Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Fri, 7 Feb 2014 15:44:19 -0300 Subject: [PATCH 13/17] initial currency values setted on header controller --- public/js/controllers/currency.js | 45 ++++++++++++++----------------- public/js/controllers/header.js | 6 +++++ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/public/js/controllers/currency.js b/public/js/controllers/currency.js index e5c7c62..ad68f95 100644 --- a/public/js/controllers/currency.js +++ b/public/js/controllers/currency.js @@ -3,37 +3,32 @@ angular.module('insight.currency').controller('CurrencyController', function($scope, $rootScope, Currency) { - $rootScope.currency = { - factor: 1, - bitstamp: 0, - symbol: 'BTC', - getConvertion: function(value) { - if (typeof value !== 'undefined' && value !== null) { - var response; - - if (this.symbol === 'USD') { - response = _roundFloat((value * this.factor), 2); - } else if (this.symbol === 'mBTC') { - this.factor = 1000; - response = _roundFloat((value * this.factor), 5); - } else { - this.factor = 1; - response = value; - } - - return response + ' ' + this.symbol; - } - - return 'value error'; - } - }; - var _roundFloat = function(x, n) { if(!parseInt(n, 10) || !parseFloat(x)) n = 0; return Math.round(x * Math.pow(10, n)) / Math.pow(10, n); }; + $rootScope.currency.getConvertion = function(value) { + if (typeof value !== 'undefined' && value !== null) { + var response; + + if (this.symbol === 'USD') { + response = _roundFloat((value * this.factor), 2); + } else if (this.symbol === 'mBTC') { + this.factor = 1000; + response = _roundFloat((value * this.factor), 5); + } else { + this.factor = 1; + response = value; + } + + return response + ' ' + this.symbol; + } + + return 'value error'; + }; + $scope.setCurrency = function(currency) { $rootScope.currency.symbol = currency; diff --git a/public/js/controllers/header.js b/public/js/controllers/header.js index e5fa3ac..7147272 100755 --- a/public/js/controllers/header.js +++ b/public/js/controllers/header.js @@ -4,6 +4,12 @@ angular.module('insight.system').controller('HeaderController', function($scope, $rootScope, getSocket, Global, Block) { $scope.global = Global; + $rootScope.currency = { + factor: 1, + bitstamp: 0, + symbol: 'BTC' + }; + $scope.menu = [ { 'title': 'Blocks', From 1837b9f211f10937609c38a0ffee7a9d036f3429 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Fri, 7 Feb 2014 16:07:06 -0300 Subject: [PATCH 14/17] disabled address fixed --- public/js/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/js/config.js b/public/js/config.js index 4d3a625..b5399ad 100755 --- a/public/js/config.js +++ b/public/js/config.js @@ -53,5 +53,6 @@ angular.module('insight') $rootScope.titleDetail = ''; $rootScope.title = $route.current.title; $rootScope.isCollapsed = true; + $rootScope.currentAddr = null; }); }); From 499578f40c09f72a004188c42dd97c3056114027 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Fri, 7 Feb 2014 16:42:26 -0300 Subject: [PATCH 15/17] tx pages: flat design for buttons --- public/css/common.css | 24 ++++++++++++++++++++++++ public/views/transaction/tx.html | 8 ++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/public/css/common.css b/public/css/common.css index f3e3b5e..75af56f 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -267,6 +267,30 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { border: 2px solid #6C0000; } +.label { + padding: .7em 2em; + font-size: 13px; + text-transform: uppercase; + font-weight:100; +} + +.label-primary { + background-color: #8DC429; +} + +.label-default { + background-color: #ffffff; + color: #333; +} + +.label-success { + background-color: #2FA4D7; +} + +.label-danger { + background-color: #AC0015; +} + .progress-bar-info { background-color: #8DC429; } /* Set the fixed height of the footer here */ diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 2d6cce8..e5eddc7 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -109,11 +109,11 @@
- + Fees: {{$root.currency.getConvertion(tx.fees)}}
- - - + {{tx.confirmations}} Confirmations + Unconfirmed Transaction! + {{$root.currency.getConvertion(tx.valueOut)}}
From ec93b9dc29008de58bb3671eb571ee8acefa1a80 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Fri, 7 Feb 2014 17:20:54 -0300 Subject: [PATCH 16/17] fixed color on blocklist title --- public/css/common.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/css/common.css b/public/css/common.css index 75af56f..9a1fa2f 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -222,6 +222,10 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { margin-top: 10px; } +.icon-block h3 { + color: #fff; +} + .block-tx { -moz-border-radius: 2px; -webkit-border-radius: 2px; From 961cff5ecac52c0392e471fa28d01ce0597af342 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Fri, 7 Feb 2014 17:39:39 -0300 Subject: [PATCH 17/17] fix when get genesis block. tx not found on rpc server --- app/controllers/transactions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/transactions.js b/app/controllers/transactions.js index e69b76d..a86f71e 100644 --- a/app/controllers/transactions.js +++ b/app/controllers/transactions.js @@ -50,10 +50,12 @@ var getTransaction = function(txid, cb) { } if (!tx || !tx.info) { -console.log('[transactions.js.48]:: TXid %s not found in RPC. CHECK THIS.', tx.txid); //TODO +console.log('[transactions.js.48]:: TXid %s not found in RPC. CHECK THIS.', txid); //TODO // not check this. no - tx.info = { - txid: tx.txid + tx = { + info: { + txid: txid + } }; }