-
Notifications
You must be signed in to change notification settings - Fork 9
/
generate.html
92 lines (83 loc) · 3.36 KB
/
generate.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>CryptoStorage - Generate</title>
<meta name="Description" content="Generate cryptocurrency keypairs in your browser. 100% open source and client-side.">
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=900px, user-scalable=no"/>
<meta property="og:title" content="Generate Keypairs">
<meta property="og:description" content="Generate cryptocurrency keypairs in your browser. 100% open source and client-side.">
<meta property="og:image" content="https://cryptostorage.com/img/cryptostorage_social.png">
<meta property="og:url" content="https://cryptostorage.com/generate.html">
<link rel="shortcut icon" href="/favicon.png" type="image/png">
<link rel="icon" href="/favicon.png" type="image/png">
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script src="lib/jquery-3.2.1.js"></script>
<script src="lib/loadjs.js"></script>
<script src="lib/async.js"></script>
<script src="lib/tippy.all.js"></script>
<script src="js/InitEditor.js"></script>
<script src="js/GenUtils.js"></script>
<script src="js/DependencyLoader.js"></script>
<script src="js/DivControllers.js"></script>
<script src="js/AppUtils.js"></script>
<script src="js/CryptoPlugins.js"></script>
<!-- Initialize -->
<script type="text/javascript">
$(document).ready(function() {
// welcome :)
console.log("Hey there! Find an issue? Let us know! Submit an issue at https://github.com/cryptostorage/cryptostorage.com/issues");
// initialize editor with config
var config = {};
config.environmentInfo = AppUtils.getCachedEnvironment();
config.genConfig = getGenConfig();
window.initEditor(window, config);
/**
* Translates url parameters into a generation config for the editor
*
* @returns a generation config if valid one given, null if invalid or not given
*/
function getGenConfig() {
// get tickers
var tickerParamValue = getParameterByName(AppUtils.TICKERS_PARAM);
if (!tickerParamValue) return null;
var tickers = tickerParamValue.split(",");
// trim and validate tickers
var tickersValid = true;
for (var i = 0; i < tickers.length; i++) {
tickers[i] = tickers[i].trim();
try { AppUtils.getCryptoPlugin(tickers[i]); }
catch (err) { return null; }
}
if (!tickers.length) return null;
// translate tickers to generation config
var genConfig = {keypairs: []};
var seriesStartIdx = 0;
for (var i = 0; i < tickers.length; i++) {
// start new ticker series
if (tickers[i] !== tickers[seriesStartIdx]) {
genConfig.keypairs.push({
ticker: tickers[seriesStartIdx],
numKeypairs: i - seriesStartIdx
});
seriesStartIdx = i;
}
// handle last element
if (i === tickers.length - 1) {
genConfig.keypairs.push({
ticker: tickers[seriesStartIdx],
numKeypairs: i - seriesStartIdx + 1
});
}
}
return genConfig;
}
});
</script>
</head>
<body>
<!-- Static content replaced by dynamic application -->
<h1>Generate cryptocurrency keypairs in your browser. 100% open source and client-side.</h1>
<h2>Passphrase-protect keypairs. Divide keypairs into parts.</h2>
</body>
</html>