From 554356773aeabc10cb5d310ed9e2749fcb5da125 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Sun, 23 Feb 2014 20:16:28 -0300 Subject: [PATCH] 1) fix rounded value for address of txout collapsed. 2) fix link of spent tx id. 3) hightlight outpoints and spents --- public/src/css/common.css | 18 +++++++++++++++--- public/src/js/config.js | 2 +- public/src/js/controllers/transactions.js | 12 ++++++++++-- public/views/transaction/tx.html | 21 ++++++++++----------- 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/public/src/css/common.css b/public/src/css/common.css index e3427952..ff5038b5 100644 --- a/public/src/css/common.css +++ b/public/src/css/common.css @@ -568,9 +568,6 @@ margin-left: 0; margin: 30px 0; } -.transaction-vin-vout .ellipsis { margin-bottom: 10px; } -.transaction-vin-vout .btc-value { margin-left: 15px; } - .page-header { margin-top: 0; } /* Index */ @@ -646,3 +643,18 @@ margin-left: 0; -webkit-animation-timing-function: linear; } +.transaction-vin-vout { + +} + +.v_hightlight { + background-color: #8DC429; + overflow: hidden; + color: #fff; +} + +a.v_hightlight_more { + background-color: #8DC429; + color: #fff; +} + diff --git a/public/src/js/config.js b/public/src/js/config.js index b1b66f83..a48a7f70 100644 --- a/public/src/js/config.js +++ b/public/src/js/config.js @@ -11,7 +11,7 @@ angular.module('insight').config(function($routeProvider) { controller: 'BlocksController', templateUrl: '/views/redirect.html' }). - when('/tx/:txId', { + when('/tx/:txId/:v_type?/:v_index?', { templateUrl: '/views/transaction.html', title: 'Bitcoin Transaction ' }). diff --git a/public/src/js/controllers/transactions.js b/public/src/js/controllers/transactions.js index e22897cb..9dbf48b4 100644 --- a/public/src/js/controllers/transactions.js +++ b/public/src/js/controllers/transactions.js @@ -58,14 +58,14 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans tmp[addr].doubleSpentIndex = tmp[addr].doubleSpentIndex || items[i].doubleSpentIndex; tmp[addr].unconfirmedInput += items[i].unconfirmedInput; tmp[addr].dbError = tmp[addr].dbError || items[i].dbError; - tmp[addr].valueSat += items[i].value * COIN; + tmp[addr].valueSat += Math.round(items[i].value * COIN); tmp[addr].items.push(items[i]); tmp[addr].notAddr = notAddr; tmp[addr].count++; } angular.forEach(tmp, function(v) { - v.value = parseInt(v.valueSat) / COIN; + v.value = v.value || parseInt(v.valueSat) / COIN; ret.push(v); }); return ret; @@ -154,6 +154,14 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans } }; + // Highlighted txout + if ($routeParams.v_type == '>' || $routeParams.v_type == '<') { + $scope.from_vin = $routeParams.v_type == '<' ? true : false; + $scope.from_vout = $routeParams.v_type == '>' ? true : false; + $scope.v_index = $routeParams.v_index; + $scope.itemsExpanded = true; + } + //Init without txs $scope.txs = []; diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index cd6c2906..94910785 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -56,7 +56,7 @@

{{$root.currency.getConvertion(vin.value)}}

-    +    {{vin.addr}} {{vin.addr}}
@@ -65,11 +65,10 @@
Double spent attempt detected. From tx: {{vin.doubleSpentTxID}},{{vin.doubleSpentIndex}}
-
-
+
scriptSig {{vin.scriptSig.asm}} @@ -80,7 +79,7 @@
@@ -101,9 +100,9 @@

- {{$root.currency.getConvertion(vout.value)}} - (S) - (U) + {{$root.currency.getConvertion(vout.value)}} + (S) + (U)

@@ -126,8 +125,8 @@

{{$root.currency.getConvertion(vout.value)}} - (U) -    + (U) +   

@@ -136,7 +135,7 @@
-
+

Type @@ -153,7 +152,7 @@