forked from MCPHackers/BetterJSONs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
93 lines (88 loc) · 2.57 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>BetterJSONs</title>
<link rel="icon" type="image/icon type" href="https://resources.download.minecraft.net/92/92750c5f93c312ba9ab413d546f32190c56d6f1f">
<style>
body {
font-family: monospace;
white-space: nowrap;
}
.version, .type, .datetime, .hash {
overflow: hidden;
display: table-cell;
padding: 0px 10px;
}
.entry {
display: table-row;
}
a {
color: #005FD3;
text-decoration: none;
}
#jsonlist {
display: block;
}
.wrapper {
display: block;
color: #2c2c2c;
background-color: #f5f5f5;
border: #CCCCCC 1px solid;
border-radius: 4px;
padding: 8px 12px;
}
</style>
</head>
<body>
<div class="wrapper" id="jsonlist">
<div class="entry">
<b class="version">Version</b>
<b class="type">Type</b>
<b class="datetime">Release time</b>
<b class="datetime">Update time</b>
<b class="hash">SHA1 hash</b>
</div>
</div>
<script>
const versionsDiv = document.getElementById("jsonlist");
fetch('version_manifest_v2.json').then((response) => response.json()).then((json) => {
for (var i = 0; i < json.versions.length; i++) {
const version = json.versions[i];
const entry = document.createElement("div");
const ahref = document.createElement("a");
ahref.className = "version";
const span1 = document.createElement("span");
span1.className = "type";
const span2 = document.createElement("span");
span2.className = "datetime";
const span3 = document.createElement("span");
span3.className = "datetime";
const span4 = document.createElement("span");
span4.className = "hash";
const id = document.createTextNode(version.id + ".json");
const type = document.createTextNode(version.type);
const time = document.createTextNode(version.releaseTime);
const updateTime = document.createTextNode(version.time);
const sha1 = document.createTextNode(version.sha1);
ahref.href = version.url;
ahref.download = version.id + ".json";
ahref.appendChild(id);
span1.appendChild(type);
span2.appendChild(time);
span3.appendChild(updateTime);
span4.appendChild(sha1);
entry.appendChild(ahref);
entry.appendChild(span1);
entry.appendChild(span2);
entry.appendChild(span3);
entry.appendChild(span4);
entry.className = "entry";
versionsDiv.appendChild(entry);
}
}).catch((err) => {
versionsDiv.innerHTML = "<b>" + err.message + "</b>";
})
</script>
</body>
</html>
%i