-
Notifications
You must be signed in to change notification settings - Fork 6
/
index3.html
executable file
·277 lines (223 loc) · 9.45 KB
/
index3.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<html>
<head>
<meta charset="utf-8">
<title>DAO Stats - The DAO Explorer</title>
<meta name="description" content="DAO Stats is an explorer for The DAO on the Ethereum network. View token transfers, proposals, votes and analytics." />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="datahelper.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">DAO Stats</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="nav.html">Search</a></li>
<li><a href="accounts.html">Accounts</a></li>
<li><a href="tokenvol.html">Graphs</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="options.html">Options</a></li>
<li><a href="about.html">About</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<!--<div class="alert alert-info alert-warning" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Down for maintenance.</strong><br />You can still view the site, but no updates will be shown.</div>-->
<div id="betaAlert" class="alert alert-info alert-dismissible collapse" role="alert"><button type="button" id="hideBetaMessage" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>DAO Stats is in beta!</strong><br />Please report any bugs or inconsistencies on <strong><a href="https://github.com/daostats/daostats.github.io">GitHub</a></strong></div>
<div class="page-header" style="margin-top:0px;">
<div class="row">
<div class="col-sm-6">
<h1>DAO Stats <sup><small><span class="label label-info">Beta</span></small></sup></h1>
</div>
<div class="col-sm-6">
<h1 class="text-right"> <small>The DAO Explorer</small></h1>
</div>
</div>
</div>
</div>
<div class="row">
<h4>Total volume: <small id="totalVol"></small>
<h4>Ether balance: <small id="ethTip" data-toggle="tooltip" title="Test"><span id="ethBal" > </span> <span class="glyphicon glyphicon-info-sign"></span></small >
</div>
<div class="row">
<div class="col-md-7">
<h3>Recent Transfers</h3>
<div class="table-responsive">
<table id="transferTable" class="table">
<thead>
<tr>
<th>Block</th>
<th>From</th>
<th>To</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<h3>Recent Proposals</h3>
<div class="table-responsive">
<table id="propTable" class="table">
<thead>
<tr>
<th>Proposal</th>
<th>Description</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div id="noProposals" class="alert alert-info collapse" role="alert">
Proposals will be made after the token sale finishes.
</div>
</div>
</div>
</div>
<div class="row">
<h3>Recent Votes</h3>
<div class="table-responsive">
<table id="voteTable" class="table">
<thead>
<tr>
<th>Proposal</th>
<th>Block</th>
<th>Supports</th>
<th>Account</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div id="noVotes" class="alert alert-info collapse" role="alert">
Votes will be cast once a proposal is made.
</div>
</div>
</div>
</div>
<script>
$(window).on('hashchange', function() {
window.location.reload(true);
});
$(document).ready( function () {
$('#table-showsent').on('click', function (e) {
tableView(false, true);
});
$('#table-showrecv').on('click', function (e) {
tableView(true, false);
});
$('#table-showall').on('click', function (e) {
tableView(false, false);
});
$('#tabs').tab();
});
function tableView(sentvis, recvvis){
if(recvvis)$('.tx-recv').addClass("hidden");
else $('.tx-recv').removeClass("hidden");
if(sentvis)$('.tx-sent').addClass("hidden");
else $('.tx-sent').removeClass("hidden");
/*$("table#transferTable").removeClass("table-striped");
// now add stripes to alternating rows
$("table#transferTable tr").each(function (index) {
alert(index);
// but first remove class that may have been added by previous changes
$(this).css("background-color", "inherit");
if ( index % 2 == 0) {
$(this).css("background-color", "#f9f9f9");
}
});*/
/*
$("tr:not(.hidden)").each(function (index) {
$(this).toggleClass("stripe", !!(index & 1));
});*/
}
getData("home", function(data, status){
/*if(status != "success"){
applyData({amount: "Account not in records"});
$("#unknownacc").collapse("show");
return;
}*/
proposals = data["prop"];
for(var i=0; i<proposals.length; i++)
{
var p = proposals[i];
console.log(p);
$('#propTable tbody').append(String.format("<tr><td><a class=\"propLink\">{0}</a></td><td>{1}</td>", p[0], p[1]));
}
if(proposals.length == 0) $("#noProposals").collapse("show");
transfers = data["transfer"];
for(var i=0; i<transfers.length; i++)
{
var t = transfers[i];
t[3] = baseToDAO(t[3]);
$('#transferTable tbody').append(String.format("<tr><td><a class=\"blockLink\">{0}</a></td><td><a class=\"accLink shrink\">{1}</a></td><td><a class=\"accLink shrink\">{2}</a></td><td>{3}</td>", t[0], t[1], t[2], t[3]));
}
votes = data["vote"];
for(var i=0; i<votes.length; i++)
{
var v = votes[i];
yn = "Nay";
if(v[2])yn = "Yay";
$('#voteTable tbody').append(String.format("<tr><td><a class=\"propLink\">{0}</a></td><td><a class=\"blockLink\">{1}</a></td><td>{2}</td><td><a class=\"accLink\">{3}</a></td>", v[0], v[1], yn, v[3]));
}
if(proposals.length == 0) $("#noVotes").collapse("show");
$("#totalVol").text(baseToDAO(data["vol"]));
console.log(data["bal"]);
extraBal = data["balEX"];
totalEth = data["bal"] + extraBal[0] + extraBal[1];
propFmt = baseToETH(data["bal"], 'eth')
depositFmt = baseToETH(extraBal[0], 'eth')
extraFmt = baseToETH(extraBal[1], 'eth')
$("#ethBal").text(baseToETH(totalEth, 'eth'));
$("#ethTip").prop("title", "Available: " + propFmt + "<br />Deposits: " + depositFmt + "<br />Token sale extra: " + extraFmt);
$('[data-toggle="tooltip"]').tooltip({
container : 'body',
html: true
});
accLink();
blockLink();
propLink();
});
if(typeof(Storage) !== undefined){
$("#hideBetaMessage").click(function(){
localStorage.hideBeta = "true";
});
if(localStorage.hideBeta != "true"){
$("#betaAlert").collapse("show");
}
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-77332805-1', 'auto');
ga('send', 'pageview', {'page': location.pathname + location.search + location.hash});
</script>
</body>
</html>