Merge branch 'master' of github.com:bitpay/mystery into feature/human-readable-times

Conflicts:
	package.json
This commit is contained in:
Manuel Araoz 2014-01-15 15:21:06 -03:00
commit 237bb81e19
6 changed files with 81 additions and 6 deletions

View File

@ -3,7 +3,7 @@
var _ = require('lodash');
// Load app configuration
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
module.exports = _.extend(
require(__dirname + '/../config/env/all.js'),
require(__dirname + '/../config/env/' + process.env.NODE_ENV + '.js') || {});

View File

@ -61,7 +61,8 @@
"should": "~2.1.1",
"view-helpers": "latest",
"socket.io": "~0.9.16",
"moment": "~2.5.0"
"moment": "~2.5.0",
"sinon": "~1.7.3"
},
"devDependencies": {
"grunt-contrib-watch": "latest",

View File

@ -118,3 +118,54 @@ body {
.fader.ng-enter-active {
opacity: 1;
}
.badge {
padding: 1px 9px 2px;
font-size: 12.025px;
font-weight: bold;
white-space: nowrap;
color: #ffffff;
background-color: #999999;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
}
.badge:hover {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.badge-error {
background-color: #b94a48;
}
.badge-error:hover {
background-color: #953b39;
}
.badge-warning {
background-color: #f89406;
}
.badge-warning:hover {
background-color: #c67605;
}
.badge-success {
background-color: #468847;
}
.badge-success:hover {
background-color: #356635;
}
.badge-info {
background-color: #3a87ad;
}
.badge-info:hover {
background-color: #2d6987;
}
.badge-inverse {
background-color: #333333;
}
.badge-inverse:hover {
background-color: #1a1a1a;
}

View File

@ -21,6 +21,11 @@ angular.module('mystery.system').controller('IndexController', ['$scope', 'Globa
$scope.blocks.unshift(block);
});
$scope.human_since = function(time) {
var m = moment.unix(time);
return m.max().fromNow();
}
$scope.index = function() {
Blocks.get({
limit: BLOCKS_DISPLAYED

View File

@ -3,14 +3,18 @@
<div class="row">
<div class="col-md-6">
<h3> New transactions </h3>
<div class="alert alert-info fader" ng-repeat='tx in txs'>
<a href="#!/tx/{{tx.txid}}">{{tx.txid}}</a>
<div class="panel fader" ng-repeat='tx in txs'>
<a class="abreviate" href="#!/tx/{{tx.txid}}">{{tx.txid}}
<span class="badge badge-success">{{human_since(tx.time)}}</span>
</a>
</div>
</div>
<div class="col-md-6">
<h3> New blocks </h3>
<div class="alert alert-success fader" ng-repeat='b in blocks'>
<a href="#!/block/{{b.hash}}">{{b.hash}}</a>
<div class="panel fader" ng-repeat='b in blocks'>
<a href="#!/block/{{b.hash}}">{{b.hash}}
<span class="badge badge-success">{{human_since(b.time)}}</span>
</a>
</div>
</div>
</div>

14
test/lib/PeerSync.js Normal file
View File

@ -0,0 +1,14 @@
'use strict';
var assert = require('assert');
var PeerSync = require('../../lib/PeerSync.js').class();
describe('Unit testing PeerSync', function() {
var ps = new PeerSync();
describe('#init()', function() {
it('should return with no errors', function() {
assert.doesNotThrow(function(){
ps.init();
});
});
});
});