-
Notifications
You must be signed in to change notification settings - Fork 420
Expand file tree
/
Copy pathapp.js
More file actions
43 lines (41 loc) · 1.46 KB
/
app.js
File metadata and controls
43 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict';
angular.module('ethExplorer', ['ngRoute','ui.bootstrap'])
.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'views/main.html',
controller: 'mainCtrl'
}).
when('/block/:blockId', {
templateUrl: 'views/blockInfos.html',
controller: 'blockInfosCtrl'
}).
when('/transaction/:transactionId', {
templateUrl: 'views/transactionInfos.html',
controller: 'transactionInfosCtrl'
}).
when('/address/:addressId', {
templateUrl: 'views/addressInfo.html',
controller: 'addressInfoCtrl'
}).
otherwise({
redirectTo: '/'
});
}])
.run(function($rootScope) {
var web3 = new Web3();
var host = window.location.hostname;
var eth_node_url = 'http://' + host + ':8545';
web3.setProvider(new web3.providers.HttpProvider(eth_node_url));
$rootScope.web3 = web3;
function sleepFor( sleepDuration ){
var now = new Date().getTime();
while(new Date().getTime() < now + sleepDuration){ /* do nothing */ }
}
var connected = false;
if(!web3.isConnected()) {
$('#connectwarning').modal({keyboard:false,backdrop:'static'})
$('#connectwarning').modal('show')
}
});