-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
415 lines (381 loc) · 14.8 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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
<!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>The Lithe Project™ - $LXTH Block Explorer</title>
<!-- vendor css -->
<link href="lib/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="lib/Ionicons/css/ionicons.css" rel="stylesheet">
<link href="lib/chartist/css/chartist.css" rel="stylesheet">
<link href="lib/select2/css/select2.min.css" rel="stylesheet">
<link href="lib/datatables/css/jquery.dataTables.css" rel="stylesheet">
<!-- Slim CSS -->
<link rel="stylesheet" href="css/themes/slim.css">
<link rel="stylesheet" href="css/themes/slim.one.css">
<link rel="stylesheet" href="css/themes/loading-indicator.css">
<!-- Leaflet CSS -->
<link rel="stylesheet" href="https://conceal.network/cdn/leaflet/css/leaflet.css">
<link rel="stylesheet" href="https://conceal.network/cdn/leaflet/css/MarkerCluster.css">
<link rel="stylesheet" href="https://conceal.network/cdn/leaflet/css/MarkerCluster.Default.css">
<link rel="stylesheet" href="https://conceal.network/cdn/leaflet/css/leaflet.fullscreen.css">
<!-- script files -->
<script src="lib/jquery/js/jquery.js"></script>
<script src="lib/popper.js/js/popper.js"></script>
<script src="lib/bootstrap/js/bootstrap.js"></script>
<script src="lib/jquery.cookie/js/jquery.cookie.js"></script>
<script src="lib/jquery.timeago/js/jquery.timeago.js"></script>
<script src="lib/select2/js/select2.full.min.js"></script>
<script src="lib/echarts/js/echarts.min.js"></script>
<script src="lib/moment/js/moment.js"></script>
<script src="lib/chart.js/js/Chart.js"></script>
<script src="lib/chartist/js/chartist.js"></script>
<script src="lib/datatables/js/jquery.dataTables.js"></script>
<script src="lib/jquery.sparkline.bower/js/jquery.sparkline.min.js"></script>
<!-- Leaflet javascript -->
<script src="https://conceal.network/cdn/leaflet/js/leaflet.js"></script>
<script src="https://conceal.network/cdn/leaflet/js/leaflet.markercluster.js"></script>
<script src="https://conceal.network/cdn/leaflet/js/leaflet.fullscreen.min.js"></script>
<script src="https://conceal.network/cdn/leaflet/js/leaflet.markercluster.freezable.js"></script>
<script src="https://conceal.network/cdn/leaflet/js/leaflet.main.js"></script>
<script src="js/loading-indicator.min.js"></script>
<script src="js/ResizeSensor.js"></script>
<script src="js/palette.js"></script>
<script src="js/slim.js"></script>
<script src="./countries.js"></script>
<script src="./config.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="slim-header">
<div class="container">
<div class="slim-header-left headerLogo">
<img src="img/logo.svg" width="48" height="58">
<div class="logoText">
<h2 class="slim-logo">
<a href="index.html">
<span>EXPLORER</span></a>
</h2>
</div>
</div>
<!-- slim-header-left -->
<div class="slim-header-right headerSearch">
<div id="stats_updated" style="display: none;">
<i class="fa fa-bolt"></i>
</div>
<!-- search-box -->
<div class="search-box">
<input type="text" id="txt_search" class="form-control" tplaceholder="searchHint"
placeholder="Search by block height / hash, transaction hash, payment id">
<button id="btn_search" class="btn btn-primary">
<i class="fa fa-search"></i>
</button>
</div>
<!-- language selector -->
<div id="langSelector">
<select id="newLang" class="form-control form-control-sm select2">
<option value="en" selected="selected">English</option>
<option value="es">Español</option>
<option value="fr">Français</option>
<option value="it">Italiano</option>
<option value="de">Deutsch</option>
<option value="ru">Русский</option>
<option value="ca">Català</option>
<option value="ko">한국어</option>
<option value="zh-CN">简体中文</option>
</select>
</div>
</div>
<!-- header-right -->
</div>
<!-- container -->
</div>
<!-- slim-header -->
<div class="slim-navbar">
<div class="container">
<ul class="nav" id="mainNavigation">
<li class="nav-item active">
<a class="nav-link hot_link" data-page="dashboard.html" href="#">
<i class="icon ion-ios-home-outline"></i>
<span tkey="dashboard">Dashboard</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link hot_link" data-page="explorer.html" href="#explorer">
<i class="icon ion-ios-filing-outline"></i>
<span tkey="explorer">Explorer</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link hot_link" data-page="pools.html" href="#pools">
<i class="icon ion-ios-analytics-outline"></i>
<span tkey="miningPools">Pools</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link hot_link nav-link-last" data-page="nodes.html" href="#nodes">
<i class="icon ion-ios-chatboxes-outline"></i>
<span tkey="nodes">Nodes</span>
</a>
</li>
<li class="nav-item with-sub">
<a class="nav-link" href="#" data-toggle="dropdown" id="toolsNavItem">
<i class="icon ion-ios-analytics-outline"></i>
<span tkey="resources">Tools</span>
</a>
<div class="sub-item">
<ul>
<li>
<a class="hot_link" data-page="api.html" href="#api">
<i class="fa fa-gears icon-dropdown"></i><span tkey="api">API</span>
</a>
</li>
<li>
<a class="hot_link" data-page="txviewer.html" href="#txviewer">
<i class="fa ion-ios-book-outline icon-dropdown"></i><span tkey="txViewer">TX Viewer</span>
</a>
</li>
<li>
<a class="hot_link" data-page="infra.html" href="#infra">
<i class="fa ion-ios-book-outline icon-dropdown"></i><span tkey="infra">Infrastructure</span>
</a>
</li>
</ul>
</div><!-- dropdown-menu -->
</li>
<li class="nav-item" 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 class="" 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 class="nav-item" 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>
</ul>
</div>
<!-- container -->
</div>
<!-- slim-navbar -->
<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>
<div class="slim-footer" id="explorerFooter">
<div class="container">
<p>Copyright 2019-2020 © The Lithe Project™ Development Team</p>
</div>
<!-- container -->
</div>
<!-- slim-footer -->
<!-- general modal error dialog -->
<div id="errorDialog" class="modal fade" style="display: none;" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content tx-size-sm">
<div class="modal-body tx-center pd-y-20 pd-x-20">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<i class="fa fa-exclamation-triangle tx-100 tx-danger lh-1 mg-t-20 d-inline-block"></i>
<h4 class="tx-danger mg-b-20">Error searching!</h4>
<p class="mg-b-20 mg-x-20" id="errorReason"></p>
<button type="button" class="btn btn-danger pd-x-25" data-dismiss="modal" aria-label="Close">Continue</button>
</div>
<!-- modal-body -->
</div>
<!-- modal-content -->
</div>
<!-- modal-dialog -->
</div>
<script src="lang/languages.js"></script>
<script>
function searchByHashOrHeight(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(value)
}
}),
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: value
}
}),
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: value
}
}),
dataType: 'json',
cache: 'false',
success: function (data) {
if (data.result) {
sessionStorage.setItem('searchTransaction', JSON.stringify(data.result));
window.location.href = getFinalUrl(transactionExplorer.replace('{id}', value));
} 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: value
}
}),
dataType: 'json',
cache: 'false',
success: function (data) {
if (data.result) {
txsByPaymentId = data.result.transactions;
sessionStorage.setItem('txsByPaymentId', JSON.stringify(txsByPaymentId));
window.location.href = getFinalUrl(paymentIdExplorer.replace('{id}', value));
} else if (data.error) {
$("#errorReason").html("We could not find anything, check if the data is correct.");
$("#errorDialog").modal();
}
}
});
}
}
});
}
}
});
}
if (value.length < 64) {
GetSearchBlockbyHeight();
} else if (value.length == 64) {
GetSearchBlock();
} else {
wrongSearchAlert();
}
}
// make sure index.html is in the URL for the explorer
if (window.location.href.indexOf("index.html") == -1) {
window.location.href = "/index.html";
} else if (GetURLParameter("hash")) {
searchByHashOrHeight(GetURLParameter("hash").trim());
}
renderLangSelector();
loadTranslations();
$('#btn_search').click(function (e) {
searchByHashOrHeight(document.getElementById('txt_search').value.trim());
e.preventDefault();
});
function wrongSearchAlert() {
$("#errorReason").html("Wrong search query!</strong><br /> Please enter block height or hash, transaction hash, or payment id.");
$("#errorDialog").modal();
}
$('#txt_search').keyup(function (e) {
if (e.keyCode === 13)
$('#btn_search').click();
}
);
</script>
<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);
});
});
});
$('#mainNavigation .nav-link').click(function () {
var newURL = window.location.href.split('?').map((url, i) => !i ? url : url.split('&').filter(p => !p.startsWith('hash' + '=')).join('&')).join('?');
if ((newURL.lastIndexOf('?') == (newURL.lastIndexOf('#') - 1)) || (newURL.substring(newURL.length - 1) == "?")) {
newURL = newURL.replace("?", "");
}
if (newURL.search("#") > -1) {
newURL = newURL.substring(0, newURL.lastIndexOf('#'));
}
if (($(this).attr("href") == "") || ($(this).attr("href") == "#")) {
window.location.href = newURL;
} else {
window.location.href = newURL + $(this).attr("href");
}
return false;
});
</script>
</body>
</html>