-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
56 lines (49 loc) · 2.33 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>GW2 Addons Repository</title>
<script src="https://unpkg.com/mithril/mithril.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">
<h1>GW2 Addons Repository</h1>
<p>This page was automatically generated. For more details, please head to the <a href="https://github.com/gw2-addon-loader/addon-repo">main repository</a>.</p>
<div class="container" id="addons-list"></div>
</div>
<script>
var root = document.getElementById("addons-list");
var list = [];
m.request({
method: "GET",
url: "addons.json",
}).then(function({ addons, manager, loader }) {
list.push(m("div", {"class": "row"}, [
m("a", {href: loader.website, target: "_blank"}, [m("h3", loader.name) ]),
m("h5", loader.developer),
m("strong", "Version: " + loader.version_id)
]));
list.push(m("div", {"class": "row"}, [
m("a", {href: manager.website, target: "_blank"}, [m("h3", manager.name) ]),
m("h5", manager.developer),
m("strong", "Version: " + manager.version_id)
]));
list.push(m("hr"));
const addonsList = Object.values(addons).sort((a, b) => a.addon_name.localeCompare(b.addon_name));
for(const addon of addonsList) {
let items = [
m("a", {href: addon.website, target: "_blank"}, [m("h3", addon.addon_name) ]),
m("h5", addon.developer),
m("p", addon.description),
m("p", `Fetched on ${new Date(addon.fetch_time).toString()}.`)
];
if(addon.version_id_is_human_readable)
items.splice(2, 0, m("strong", "Version: " + addon.version_id));
list.push(m("div", {"class": "row"}, items));
}
m.render(root, list);
});
</script>
</body>
</html>