forked from k06a/parity-trace-decoder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
70 lines (62 loc) · 2.95 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
<!DOCTYPE html>
<html>
<head>
<title>Parity Traces Decoder</title>
<meta charset="utf-8">
<!-- Viewport Meta Tag -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Latest compiled and minified Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel=StyleSheet href="jquery-simplefolders/main.css" type="text/css" media=screen>
<style>
.tab-pane {
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
border-bottom: 1px solid #ddd;
border-radius: 0px 0px 5px 5px;
padding: 10px;
}
.nav-tabs {
margin-bottom: 0;
}
</style>
</head>
<body>
<!-- YOUR CONTENT STARTS HERE -->
<div class="container-fluid">
<div class="form-group">
<label for="parity-traces">Parity traces:</label>
<textarea class="form-control" rows="10" id="parity-traces"></textarea>
</div>
<div class="form-group">
<label for="parity-tree">Decoded call tree:</label><br/>
<code><pre id="parity-tree"></pre></code>
</div>
</div>
<!-- YOUR CONTENT ENDS HERE -->
<!-- JavaScript: placed at the end of the document so the pages load faster -->
<!-- jQuery library -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js" crossorigin="anonymous"></script>
<!-- Popper -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<!-- Latest compiled and minified Bootstrap JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="jquery-simplefolders/main.js"></script>
<script src="./web-decoder.js"></script>
<script>
let methods;
$.getJSON('./4bytes.json').then(function (json) {
methods = json;
console.log('Loaded ' + Object.keys(methods).length + ' method hashes');
});
$('#parity-traces').bind('input', async function () {
let tracesStr = $('#parity-traces').val();
if (!tracesStr.startsWith('[')) {
tracesStr = '[' + tracesStr + ']';
}
const traces = JSON.parse(tracesStr);
$('#parity-tree').html(decoder(traces, methods) + '<br/>');
});
</script>
</body>
</html>