From f03bd89bcd3ec5828c33058d528219222ed37b17 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 30 Jan 2014 17:33:58 -0300 Subject: [PATCH 1/3] Important Fix on URL routing (Node.js catch all request first, then throught Angular.js) --- config/express.js | 4 +++- config/routes.js | 18 ++++-------------- public/js/directives.js | 1 - 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/config/express.js b/config/express.js index 7ac2645..692b322 100644 --- a/config/express.js +++ b/config/express.js @@ -49,12 +49,14 @@ module.exports = function(app, historicSync) { //dynamic helpers app.use(helpers(config.app.name)); + // IMPORTAMT: for html5mode, this line must to be before app.router + app.use(express.static(config.root + '/public')); + //routes should be at the last app.use(app.router); //Setting the fav icon and static folder app.use(express.favicon()); - app.use(express.static(config.root + '/public')); //Assume "not found" in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc. app.use(function(err, req, res, next) { diff --git a/config/routes.js b/config/routes.js index 4a134a2..81189fe 100644 --- a/config/routes.js +++ b/config/routes.js @@ -2,20 +2,6 @@ module.exports = function(app, historicSync) { - //Home route - var index = require('../app/controllers/index'); - - app.get('/', index.render); - app.get('/blocks', index.render); - app.get('/status', index.render); - app.get('/blocks-date/*', index.render); - app.get('/block-index/*', index.render); - app.get('/block/*', index.render); - app.get('/tx/*', index.render); - app.get('/address/*', index.render); - - app.get('/api/version', index.version); - //Block routes var blocks = require('../app/controllers/blocks'); app.get('/api/blocks', blocks.list); @@ -44,4 +30,8 @@ module.exports = function(app, historicSync) { app.get('/api/sync', st.sync); + //Home route + var index = require('../app/controllers/index'); + app.get('/api/version', index.version); + app.get('*', index.render); }; diff --git a/public/js/directives.js b/public/js/directives.js index 9dcaffa..3bd91db 100755 --- a/public/js/directives.js +++ b/public/js/directives.js @@ -50,7 +50,6 @@ angular.module('insight') scope.$on('$destroy', function() { client.off('mousedown', onMousedown); - client.unglue(elm); }); }); } From edef9f0a3adacb978b952e9e6dd8bebecd4991e5 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 30 Jan 2014 18:00:48 -0300 Subject: [PATCH 2/3] cleaning foot.jade --- app/views/includes/foot.jade | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index f25748a..c7f5807 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -1,7 +1,5 @@ #footer(data-ng-include="'/views/footer.html'", role='navigation') -//script(type='text/javascript', src='/lib/jquery/jquery.min.js') -//script(type='text/javascript', src='/lib/bootstrap/dist/js/bootstrap.min.js') 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/qrcode-generator/js/qrcode.js') From fb83126f6016ac38fb71c0c967147cd57f9cbe5f Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 30 Jan 2014 18:33:33 -0300 Subject: [PATCH 3/3] added hash with copy/paste link on blockpage --- public/css/common.css | 9 +++++++-- public/views/block.html | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/public/css/common.css b/public/css/common.css index 0b960b8..939ee0d 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -208,8 +208,8 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { .icon-block { color: #FFFFFF; - font-size: 27px; - margin-top: 20px; + font-size: 35px; + margin-top: 10px; } .block-tx { @@ -400,3 +400,8 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { .transaction-vin-vout .ellipsis { margin-bottom: 10px; } .transaction-vin-vout .btc-value { margin-left: 15px; } + +.block_hash { + margin-left: 46px; + text-align: center; +} diff --git a/public/views/block.html b/public/views/block.html index c9f2268..2342f37 100644 --- a/public/views/block.html +++ b/public/views/block.html @@ -7,14 +7,14 @@

Block #{{ block.height }}

-
+ +

Hashes

- - - -
Hash {{block.hash}}
Previous Block {{block.previousblockhash}}