-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
80 lines (74 loc) · 3.27 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="http://cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
<link rel="stylesheet" href="http://cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-sha256/0.9.0/sha256.min.js"></script>
<script src="./node_modules/orbs-client-sdk/dist/orbs-client-sdk.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.core.js"></script>
<!-- <script src="./index.js"></script> -->
<script src="./app.js"></script>
<script src="./dc.js" onerror="alert('Cannot find contract deployment file \'dc.js\'. Please run \'node flow.js\' to generate it')"></script>
<script>
function getSender() {
if (!localStorage.getItem("sender_public_key")) {
const sender = Orbs.createAccount();
localStorage.setItem("sender_public_key", Orbs.encodeHex(sender.publicKey));
localStorage.setItem("sender_private_key", Orbs.encodeHex(sender.privateKey));
localStorage.setItem("sender_address", sender.address);
}
return {
publicKey: Orbs.decodeHex(localStorage.getItem("sender_public_key")),
privateKey: Orbs.decodeHex(localStorage.getItem("sender_private_key")),
address: localStorage.getItem("sender_address")
}
}
// Local settings
const params = {
endpoint: "http://localhost:8080",
virtualChainId: 42,
channel: "orbs",
prismEndpoint: "https://prism.orbs-test.com",
contractName: contractName,
employee: {
publicKey: employeePublicKey,
privateKey: employeePrivateKey
}
};
window.app = new App(Orbs, params, getSender(), getSender());
</script>
<style>
#messages {
font-family: monospace;
white-space: pre;
}
</style>
</head>
<body onload="window.app.showInfo();window.app.generateSecret()">
<main class="wrapper">
<nav class="navigation">
<section class="container">
<a class="navigation-title" href="#message_form">
<h1 class="title">Infected Mushroom Tickets Florence 2019</h1>
<span>Your address <span id="address"></span></span>,
<span>contract <span id="contract_name"></span></span>
</a>
</section>
</nav>
<div id="tickets" class="container">
</div>
<div class="container" id="message_form">
<br/>
<form>
<fieldset>
<input type="text" id="id_number" rows="10" placeholder="ID number"/>
<input type="text" id="name" rows="10" placeholder="Name"/>
<input type="text" id="one_time_secret" rows="10" disabled placeholder="Secret"/>
<input type="button" onclick="window.app.submitForm();" value="BUY! BUY! BUY!">
</fieldset>
</form>
</div>
</main>
</body>
</html>