forked from TheBusyBiscuit/builds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
116 lines (98 loc) · 5.51 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE HTML>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-128369013-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-128369013-2');
</script>
<title>Repo Server</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,700" rel="stylesheet">
<link rel="icon" type="image/png" sizes="32x32" href="https://avatars0.githubusercontent.com/u/25465545?s=32&v=4">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$.getJSON("https://poma123.github.io/builds/resources/repos.json", function(repos) {
$("#repos").html("");
var profiles = [];
for (var repo in repos) {
if (!profiles.includes(repo.split("/")[0])) {
console.log("Found Author \"" + repo.split("/")[0] + "\"");
profiles.push(repo.split("/")[0]);
addProfile(repo.split("/")[0], repos);
}
}
console.log(profiles);
});
});
function addProfile(user, repos) {
$("#repos").append('<div class="box" style="width: 65%; margin: 2vh auto;"><a style="padding-top: 1vh;" class="link_build link_repo" href="https://github.com/' + user + '">' + user + '</a><table id="projects_' + user + '" class="info_table"></table></div>');
var table = $("#projects_" + user);
for (var repo in repos) {
if (repo.split("/")[0] !== user) continue;
console.log("Found Project \"" + repo + "\"");
let repository = repo.split('/')[1].split(":")[0];
let branch = repo.split('/')[1].split(":")[1];
// The directory for the project
let directory = `${user}/${repository}/${branch}`;
let projectType = repos[repo].abandoned ? "abandoned" : "alive";
addRepository(table, directory, user, repository, branch, projectType, repos);
}
// Alphabetical sorting
$(table).append(table.children("tr").sort((a, b) => sortProjects($(a), $(b))));
}
function addRepository(table, directory, owner, repo, branch, projectType, repos) {
//let html = "";
var info = repos[owner + "/" + repo + ":" + branch];
var description = "";
if (info.options.description != null) {
description = info.options.description;
}
// html += "<tr class="projectType" project=\"" + repo + ":" + branch + "\"><td class=\"icon\"><img class=\"icon\" alt=\"project page\" src=\"https://poma123.github.io/builds/resources/content/octicons/beaker.svg\"></td>";
// html += '<td class="table_label" style="width: auto;"><a class="link_info" href="' + owner + '/' + repo + '/' + branch + '">' + (repo + " (" + branch + ")") + "</a><a class=\"link_info2\">" + description + "</a></td><td>";
// html += '<img style="float: right;" alt=\"project badge\" src="https://poma123.github.io/builds/' + owner + '/' + repo + '/' + branch + '/badge.svg"/></td></tr>';
// table.append(html);
table.append(
`<tr class="${projectType}" project="${repo}:${branch}">
<td class="icon">
<img class="icon" alt="project page" src="https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/beaker.svg" />
</td>
<td class="table_label" style="width: auto;">
<a class="link_info" href="${directory}">${repo} (${branch})${projectType == 'abandoned' ? " [abandoned]": ""}</a>
<a class="link_info2">${description}</a>
</td>
<td>
<img style="float: right;" alt="project badge" src="https://poma123.github.io/builds/${directory}/badge.svg" />
</td>
</tr>
`);
}
function sortProjects(a, b) {
if (a.hasClass("abandoned") && !b.hasClass("abandoned")) {
return 1;
} else if (!a.hasClass("abandoned") && b.hasClass("abandoned")) {
return -1;
} else {
return a.attr("project").toUpperCase() > b.attr("project").toUpperCase() ? 1 : -1;
}
}
</script>
</head>
<body>
<div class="header">
<p class="headher">poma123's Repo Server</p>
<a class="link_main2" href="https://thebusybiscuit.github.io/builds/">(Made by TheBusyBiscuit)</a>
</div>
<div id="repos" class="page">
<div class="box repo">
<div style="width: 100%; text-align: center;">
<img style="width: 30%;" class="loading" alt="loading" src="https://poma123.github.io/builds/resources/content/octicons/sync.svg"/>
</div>
</div>
</div>
</body>
</html>