From 16d1a6fe16e2f44fa796fd48edee79ff88853b39 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Thu, 23 Jan 2014 17:02:06 -0300 Subject: [PATCH] fix conflicts. Removed hashbang route for html5mode. Changed all urls and route for epxress --- app/views/includes/foot.jade | 2 +- app/views/includes/head.jade | 1 + app/views/includes/navbar.jade | 2 +- config/express.js | 1 - config/routes.js | 9 ++++++++- public/js/config.js | 17 +++++++++-------- public/js/directives.js | 2 +- public/js/init.js | 2 +- public/views/address.html | 2 +- public/views/block.html | 6 +++--- public/views/blocks/list.html | 11 ++++++++--- public/views/header.html | 4 ++-- public/views/index.html | 4 ++-- public/views/status.html | 8 ++++---- public/views/transaction.html | 2 +- public/views/transaction/tx.html | 10 +++++----- 16 files changed, 48 insertions(+), 35 deletions(-) diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index 6c19c86..f25748a 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -1,4 +1,4 @@ -#footer(data-ng-include="'views/footer.html'", role='navigation') +#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') diff --git a/app/views/includes/head.jade b/app/views/includes/head.jade index d056400..a3ed958 100755 --- a/app/views/includes/head.jade +++ b/app/views/includes/head.jade @@ -2,6 +2,7 @@ head meta(charset='utf-8') meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1') meta(name='viewport', content='width=device-width,initial-scale=1.0') + meta(name="fragment", content="!") title= appName+' - '+title meta(http-equiv='Content-type', content='text/html;charset=UTF-8') diff --git a/app/views/includes/navbar.jade b/app/views/includes/navbar.jade index a1b2b1c..10463d6 100644 --- a/app/views/includes/navbar.jade +++ b/app/views/includes/navbar.jade @@ -1 +1 @@ -.navbar.navbar-default.navbar-fixed-top(data-ng-include="'views/header.html'", role='navigation') +.navbar.navbar-default.navbar-fixed-top(data-ng-include="'/views/header.html'", role='navigation') diff --git a/config/express.js b/config/express.js index 0b9c284..7ac2645 100644 --- a/config/express.js +++ b/config/express.js @@ -52,7 +52,6 @@ module.exports = function(app, historicSync) { //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')); diff --git a/config/routes.js b/config/routes.js index 3c3e198..d7d57d8 100644 --- a/config/routes.js +++ b/config/routes.js @@ -4,7 +4,14 @@ module.exports = function(app, historicSync) { //Home route var index = require('../app/controllers/index'); + app.get('/', index.render); + app.get('/blocks', index.render); + app.get('/blocks-date/*', 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 @@ -34,5 +41,5 @@ module.exports = function(app, historicSync) { app.get('/api/status', st.show); app.get('/api/sync', st.sync); - + }; diff --git a/public/js/config.js b/public/js/config.js index 9791eb0..eaddc38 100755 --- a/public/js/config.js +++ b/public/js/config.js @@ -5,32 +5,32 @@ angular.module('insight').config(['$routeProvider', function($routeProvider) { $routeProvider. when('/block/:blockHash', { - templateUrl: 'views/block.html' + templateUrl: '/views/block.html' }). when('/block-index/:blockHeight', { controller: 'BlocksController', template: 'Redirecting...' }). when('/tx/:txId', { - templateUrl: 'views/transaction.html' + templateUrl: '/views/transaction.html' }). when('/', { - templateUrl: 'views/index.html' + templateUrl: '/views/index.html' }). when('/blocks', { - templateUrl: 'views/blocks/list.html' + templateUrl: '/views/blocks/list.html' }). when('/blocks-date/:blockDate', { - templateUrl: 'views/blocks/list.html' + templateUrl: '/views/blocks/list.html' }). when('/address/:addrStr', { - templateUrl: 'views/address.html' + templateUrl: '/views/address.html' }). when('/status', { - templateUrl: 'views/status.html' + templateUrl: '/views/status.html' }). otherwise({ - templateUrl: 'views/404.html' + templateUrl: '/views/404.html' }); } ]); @@ -38,6 +38,7 @@ angular.module('insight').config(['$routeProvider', //Setting HTML5 Location Mode angular.module('insight').config(['$locationProvider', function($locationProvider) { + $locationProvider.html5Mode(true); $locationProvider.hashPrefix('!'); } ]); diff --git a/public/js/directives.js b/public/js/directives.js index d7c2f8e..9dcaffa 100755 --- a/public/js/directives.js +++ b/public/js/directives.js @@ -29,7 +29,7 @@ angular.module('insight') }]) .directive('clipCopy', [function() { ZeroClipboard.config({ - moviePath: '../lib/zeroclipboard/ZeroClipboard.swf', + moviePath: '/lib/zeroclipboard/ZeroClipboard.swf', trustedDomains: ['*'], allowScriptAccess: 'always', forceHandCursor: true diff --git a/public/js/init.js b/public/js/init.js index 5f49071..d0da1d0 100755 --- a/public/js/init.js +++ b/public/js/init.js @@ -1,6 +1,6 @@ 'use strict'; angular.element(document).ready(function() { - //Then init the app + // Init the app angular.bootstrap(document, ['insight']); }); diff --git a/public/views/address.html b/public/views/address.html index 4c1e953..dc5633a 100644 --- a/public/views/address.html +++ b/public/views/address.html @@ -6,7 +6,7 @@
- {{address.addrStr}} + {{address.addrStr}}
diff --git a/public/views/block.html b/public/views/block.html index 3cf4efb..0641473 100644 --- a/public/views/block.html +++ b/public/views/block.html @@ -14,15 +14,15 @@ Hash - {{block.hash}} + {{block.hash}} Previous Block - {{block.previousblockhash}} + {{block.previousblockhash}} Next Block - {{block.nextblockhash}} + {{block.nextblockhash}} Merkle Root diff --git a/public/views/blocks/list.html b/public/views/blocks/list.html index 96f881b..2a82589 100644 --- a/public/views/blocks/list.html +++ b/public/views/blocks/list.html @@ -10,8 +10,8 @@

{{pagination.current}}

- ← {{pagination.prev}} - {{pagination.next}} → + ← {{pagination.prev}} + {{pagination.next}} →
@@ -37,7 +37,7 @@ Waiting for blocks... - {{b.height}} + {{b.height}} {{b.time * 1000 | date:'medium'}} {{b.tx.length}} {{b.size}} @@ -45,6 +45,11 @@ +

No blocks yet.

diff --git a/public/views/header.html b/public/views/header.html index f1cca46..ffe876f 100755 --- a/public/views/header.html +++ b/public/views/header.html @@ -1,11 +1,11 @@
diff --git a/public/views/index.html b/public/views/index.html index b9cf71d..f07e0f5 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -20,7 +20,7 @@ Waiting for blocks... - {{b.height}} + {{b.height}} {{humanSince(b.time)}} {{b.tx.length}} @@ -51,7 +51,7 @@ Waiting for transactions... - {{tx.txid}} + {{tx.txid}} {{humanSince(tx.time)}} {{tx.valueOut}} diff --git a/public/views/status.html b/public/views/status.html index d5f99bb..04fdb57 100644 --- a/public/views/status.html +++ b/public/views/status.html @@ -46,11 +46,11 @@ Height - {{txoutsetinfo.height}} + {{txoutsetinfo.height}} Best Block - {{txoutsetinfo.bestblock}} + {{txoutsetinfo.bestblock}} Transactions @@ -80,7 +80,7 @@ Last Block Hash - {{lastblockhash}} + {{lastblockhash}} @@ -102,7 +102,7 @@ Blocks - {{info.blocks}} + {{info.blocks}} Time Offset diff --git a/public/views/transaction.html b/public/views/transaction.html index 2a688e1..f9793e3 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -25,7 +25,7 @@ Block - {{tx.blockhash}} + {{tx.blockhash}}
diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 4ea7219..cac70f1 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -1,7 +1,7 @@
- {{tx.txid}} + {{tx.txid}}
@@ -20,7 +20,7 @@
{{vin.value}} BTC
{{vin.addr}} - {{vin.addr}} + {{vin.addr}}
@@ -30,7 +30,7 @@
   {{vin.addr}} - {{vin.addr}} + {{vin.addr}}
@@ -56,7 +56,7 @@
{{vout.value}} BTC
{{vout.addr}} - {{address}} + {{address}}
@@ -64,7 +64,7 @@
{{vout.value}} BTC