forked from turtle0x1/block-explorer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
303 lines (262 loc) · 9.85 KB
/
index.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="image/icon" href="favicon.ico" >
<title>TurtleCoin [TRTL] Block Explorer</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.0/jquery.timeago.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-sparklines/2.1.2/jquery.sparkline.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="css/themes/turtle/style.css" rel="stylesheet" id="theme_link">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="./config.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand " href="#"><img src="img/icon_light.png"> <strong>TURTLE</strong>COIN</a>
<div id="stats_updated"><i class="fa fa-bolt"></i></div>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-left explorer_menu">
<li><a class="hot_link" data-page="home.html" href="#">
<i class="fa fa-cubes" aria-hidden="true"></i> Block Explorer
</a></li>
<li><a class="hot_link" data-page="check_txn.html" href="#check_txn">
<i class="fa fa-exchange" aria-hidden="true"></i> Check TXNs
</a></li>
<li><a class="hot_link" data-page="pools.html" href="#pools">
<i class="fa fa-gavel" aria-hidden="true"></i> Pools
</a></li>
<li><a class="hot_link" data-page="api.html" href="#api">
<i class="fa fa-code" aria-hidden="true"></i> API
</a></li>
<li style="display:none;"><a class="hot_link" data-page="blockchain_block.html" href="#blockchain_block"><i class="fa fa-cubes"></i> Block
</a></li>
<li style="display:none;"><a class="hot_link" data-page="blockchain_transaction.html" href="#blockchain_transaction"><i class="fa fa-cubes"></i> Transaction
</a></li>
<li style="display:none;"><a class="hot_link" data-page="blockchain_payment_id.html" href="#blockchain_payment_id"><i class="fa fa-cubes"></i> Transactions by Payment ID
</a></li>
<li><a style="display:none;" class="hot_link" data-page="support.html" href="#support">
<i class="fa fa-comments"></i> Help
</a></li>
<!-- //-->
</ul>
<div class="nav col-md-6 navbar-right explorer-search">
<div class="input-group">
<input class="form-control" placeholder="Search by block height / hash, transaction hash, payment id" id="txt_search">
<span class="input-group-btn"><button class="btn btn-default" type="button" id="btn_search">
<span><i class="fa fa-search"></i> Search</span>
</button></span>
</div>
</div>
</div>
</div>
</div>
<script>
$('#btn_search').click(function(e) {
var text = document.getElementById('txt_search').value;
function GetSearchBlockbyHeight(){
var block, xhrGetSearchBlockbyHeight;
if (xhrGetSearchBlockbyHeight) xhrGetSearchBlockbyHeight.abort();
xhrGetSearchBlockbyHeight = $.ajax({
url: api + '/json_rpc',
method: "POST",
data: JSON.stringify({
jsonrpc:"2.0",
id: "blockbyheight",
method:"getblockheaderbyheight",
params: {
height: parseInt(text)
}
}),
dataType: 'json',
cache: 'false',
success: function(data){
if(data.result){
block = data.result.block_header;
window.location.href = getBlockchainUrl(block.hash);
} else if(data.error) {
wrongSearchAlert();
}
}
});
}
function GetSearchBlock(){
var block, xhrGetSearchBlock;
if (xhrGetSearchBlock) xhrGetSearchBlock.abort();
xhrGetSearchBlock = $.ajax({
url: api + '/json_rpc',
method: "POST",
data: JSON.stringify({
jsonrpc:"2.0",
id: "GetSearchBlock",
method:"f_block_json",
params: {
hash: text
}
}),
dataType: 'json',
cache: 'false',
success: function(data){
if(data.result){
block = data.result.block;
sessionStorage.setItem('searchBlock', JSON.stringify(block));
window.location.href = getBlockchainUrl(block.hash);
} else if(data.error) {
$.ajax({
url: api + '/json_rpc',
method: "POST",
data: JSON.stringify({
jsonrpc:"2.0",
id: "test",
method:"f_transaction_json",
params: {
hash: text
}
}),
dataType: 'json',
cache: 'false',
success: function(data){
if(data.result){
sessionStorage.setItem('searchTransaction', JSON.stringify(data.result));
window.location.href = transactionExplorer.replace('{id}', text);
} else if(data.error) {
xhrGetTsx = $.ajax({
url: api + '/json_rpc',
method: "POST",
data: JSON.stringify({
jsonrpc:"2.0",
id: "test",
method:"k_transactions_by_payment_id",
params: {
payment_id: text
}
}),
dataType: 'json',
cache: 'false',
success: function(data){
if(data.result){
txsByPaymentId = data.result.transactions;
sessionStorage.setItem('txsByPaymentId', JSON.stringify(txsByPaymentId));
window.location.href = paymentIdExplorer.replace('{id}', text);
} else if(data.error) {
$('#page').after(
'<div class="alert alert-warning alert-dismissable fade in" style="position: fixed; right: 50px; top: 50px;">'+
'<button type="button" class="close" ' +
'data-dismiss="alert" aria-hidden="true">' +
'×' +
'</button>' +
'We could not find anything.' +
'</div>');
}
}
});
}
}
});
}
}
});
}
if ( text.length < 64 ) {
GetSearchBlockbyHeight();
} else if ( text.length == 64 ) {
GetSearchBlock();
} else {
wrongSearchAlert();
}
e.preventDefault();
});
function wrongSearchAlert() {
$('#page').after(
'<div class="alert alert-danger alert-dismissable fade in" style="position: fixed; right: 50px; top: 50px;">'+
'<button type="button" class="close" ' +
'data-dismiss="alert" aria-hidden="true">' +
'×' +
'</button>' +
'<strong>Wrong search query!</strong><br /> Please enter block height or hash, transaction hash, or payment id.' +
'</div>');
}
$('#txt_search').keyup(function(e){
if(e.keyCode === 13)
$('#btn_search').click();
});
</script>
<div id="content">
<div class="container">
<div id="page"></div>
<p id="loading" class="text-center"><i class="fa fa-circle-o-notch fa-spin"></i></p>
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-4 col-sm-4 text-center" id="donations" style="word-wrap:break-word; display:none;">
Donations welcome:<br/>
<span id="donationAddress"></span><br/><br/>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-3 col-sm-3 text-center">
<p>
<small>
© 2018 <strong>TRTLD13</strong>
</small>
</p>
</div>
<div class="col-lg-4 col-md-3 col-sm-6 text-center">
<p>
<small>
<!-- This copyright should be left intact -->
Powered by <a target="_blank" href="https://github.com/turtlecoin/block-explorer"><i class="fa fa-github"></i> Turtle Blockchain Explorer</a> v. 1.0.0.<br />
<span class="text-muted">Code from <strong>Karbowanec Blockchain Explorer</strong><br />
<span class="text-muted">Partially based on <strong>cryptonote-universal-pool</strong><br />
open sourced under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL</a></span>
</small>
</p>
</div>
<div class="col-lg-4 col-md-3 col-sm-3 text-center">
<ul class="list-unstyled">
<li><a href="http://turtlecoin.lol/">TURTLECOIN.LOL</a></li>
</ul>
</div>
</div>
</div>
</footer>
<a href="#" class="scrollup"><i class="fa fa-chevron-circle-up"></i></a>
<script type="text/javascript">
jQuery(function($) { $(document).ready(function() {
$(window).scroll(function(){
if ($(this).scrollTop() > 500) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$('.scrollup').css('opacity','0.3');
$('.scrollup').hover(function(){
$(this).stop().animate({opacity: 0.9}, 400);
}, function(){
$(this).stop().animate({opacity: 0.3}, 400);
});
});});
</script>
</body>
</html>