Skip to content

Commit 43149b4

Browse files
authored
reformat a bit in github editor
1 parent 9392421 commit 43149b4

1 file changed

Lines changed: 29 additions & 25 deletions

File tree

index.html

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>MCSR Rules</title>
7-
<script>
8-
function docLoad() {
9-
jsElement = document.getElementById("js")
10-
jsElement.innerHTML = ""
11-
link = document.getElementById("githack_link")
12-
link.innerHTML = "loading"
13-
fetch("https://api.github.com/repos/Minecraft-Java-Edition-Speedrunning/rules/contents/pub/pdf")
14-
.then(res => {
15-
if (!res.ok) {
16-
jsElement.innerHTML = "GitHub API Failed!"
17-
throw new Error(`HTTP error! status: ${response.status}`);
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>MCSR Rules</title>
8+
<script>
9+
function docLoad() {
10+
jsElement = document.getElementById("js")
11+
jsElement.innerHTML = ""
12+
link = document.getElementById("githack_link")
13+
link.innerHTML = "loading"
14+
fetch("https://api.github.com/repos/Minecraft-Java-Edition-Speedrunning/rules/contents/pub/pdf")
15+
.then(res => {
16+
if (!res.ok) {
17+
jsElement.innerHTML = "github api failed :("
18+
throw new Error("http error :( status: " + response.status);
19+
}
20+
return res.json();
21+
})
22+
.then(data => {
23+
data.filter(it => !it.name.includes("beta")).sort(it => it.name.split(".")[0].split("_").at(-1))
24+
pdf_url = "https://rawcdn.githack.com/Minecraft-Java-Edition-Speedrunning/rules/main/pub/pdf/" + data.at(-1).name
25+
link.href = link.innerHTML = window.location.href = pdf_url
26+
})
1827
}
19-
return res.json();
20-
})
21-
.then(data => {
22-
data.filter(it => !it.name.includes("beta")).sort(it => it.name.split(".")[0].split("_").at(-1))
23-
pdf_url = "https://rawcdn.githack.com/Minecraft-Java-Edition-Speedrunning/rules/main/pub/pdf/" + data.at(-1).name
24-
link.href = link.innerHTML = window.location.href = pdf_url
25-
})
26-
}
27-
</script>
28+
</script>
2829
</head>
30+
2931
<body onload="docLoad()">
30-
<p>redirecting to: <span id="js">this site requires javascript.</span> <a id="githack_link" href="https://github.com/Minecraft-Java-Edition-Speedrunning/rules"> click here for the rules repo</a>.</p>
32+
<p>redirecting to: <span id="js">this site requires javascript.</span> <a id="githack_link"
33+
href="https://github.com/Minecraft-Java-Edition-Speedrunning/rules"> click here for the rules repo</a>.</p>
3134
</body>
32-
</html>
35+
36+
</html>

0 commit comments

Comments
 (0)