Merge pull request #94 from maraoz/feature/tx-sound

Feature/tx sound
This commit is contained in:
Manuel Aráoz 2014-01-20 12:42:52 -08:00
commit e3ccb18b57
4 changed files with 9 additions and 4 deletions

View File

@ -171,10 +171,13 @@ TransactionSchema.statics.explodeTransactionItems = function(txid, time, cb) {
TransactionItem.create({
txid : txid,
value_sat : o.valueSat,
addr : o.scriptPubKey.addresses[0],
addr : o.scriptPubKey.addresses[0], // TODO: only address 0?
index : o.n,
ts : time,
}, next_out);
if (addrs.indexOf(o.scriptPubKey.addresses[0]) === -1) {
addrs.push(o.scriptPubKey.addresses[0]);
}
}
else {
console.log ('WARN in TX: %s could not parse OUTPUT %d', txid, o.n);

View File

@ -22,7 +22,7 @@ angular.module('insight.transactions').controller('transactionsController',
txId: txid
}, function(tx) {
$scope.tx = tx;
$scope.txs.push(tx);
$scope.txs.unshift(tx);
}, function(e) {
if (e.status === 400) {
$rootScope.flashMessage = 'Invalid Transaction ID: ' + $routeParams.txId;
@ -54,7 +54,9 @@ angular.module('insight.transactions').controller('transactionsController',
};
var socket = get_socket($scope);
socket.on('atx', function(tx) {
console.log('Incoming transaction for address!', tx);
console.log('atx '+tx.txid);
var beep = new Audio('/sound/transaction.mp3');
beep.play();
$scope.findTx(tx.txid);
});

Binary file not shown.

View File

@ -1,6 +1,6 @@
<div data-ng-show="!txs || txs.lenght">Loading...</div>
<div class="alert alert-warning" data-ng-show="txs && !txs[0].txid">There are not transactions</div>
<div class="block-tx" data-ng-show="txs && txs[0].txid" data-ng-repeat="tx in txs">
<div class="block-tx fader" data-ng-show="txs && txs[0].txid" data-ng-repeat="tx in txs">
<div class="line-bot">
<a href="/#!/tx/{{tx.txid}}">{{tx.txid}}</a>
<span class="pull-right">{{tx.time * 1000 | date:'medium'}}</span>