-
Notifications
You must be signed in to change notification settings - Fork 6
/
source-browser.html
253 lines (229 loc) · 18 KB
/
source-browser.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!DOCTYPE html>
<html lang="en">
<head>
<title>Apertium Source Browser</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Sushain K. Cherivirala">
<link rel="shortcut icon" href="https://apertium.org/img/favicon.ico">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/basscss.min.css" integrity="sha384-/biuPsPEkt10QoeOExIADuWNrpFFXALKPgBhEDkRdKDJdQOPpbNU3uUeFbL/KPJg" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/hint.css/2.5.0/hint.base.min.css" integrity="sha256-ODFgZG+Y3V10lzZu+7J8epM4SdW0w3p8qbVmmShNrtk=" crossorigin="anonymous">
<style type="text/css">
#content {
margin-top: 75px;
overflow-x: hidden;
}
#logo-text {
color: #808080;
font-family: 'DejaVu Sans', 'DejaVu Sans Fallback', 'Arial #000', Arial;
font-size: 2.25em;
margin-left: -10px;
}
.topic {
min-width: 215px;
}
#loading {
animation: spin 2.5s infinite linear;
}
@keyframes spin {
from {transform:rotate(0deg);}
to {transform:rotate(360deg);}
}
a.text-decoration-none:hover {
text-decoration: none;
}
[class*="hint--"][aria-label]:after {
white-space: normal;
line-height: 1.4em;
max-width: 200px;
width: max-content;
}
.sticky {
position: -webkit-sticky;
position: sticky;
top: 5px;
z-index: 100;
background-color: white;
width: 100%;
}
.sticky-bottom {
border-top: 0.02em solid rgb(216, 216, 216);
position: fixed;
bottom: -8px;
z-index: 100;
background-color: white;
height: fit-content;
min-width: fit-content;
}
#refresh {
z-index: 1000;
right: 20px;
bottom: 30px;
}
#navbar {
z-index: 1000;
}
</style>
</head>
<body class="m2">
<div id="navbar" class="fixed top-0 col-12 py1 mr3 bg-white z1">
<a href="https://apertium.org" target="_blank" rel="noopener" class="mt2 text-decoration-none nowrap"> <!-- apertium.org is slow and hosts a large version -->
<img id="logo" alt="Apertium" height="50" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAA8CAYAAAAwoHcgAAAZlElEQVR42t2beZQcV5Xmf++9WDKzdlVJpX2xZMu2MF7kDYzd8tYGm6WBkVi6ATdwzOme03C6m57hADOUB6anBwZo4AwcaJYeVqOCocG0he0GlbEEeJFly9plqbSUSkupqlSVlUss7935IyOldKlklWVgmIlz3onIiMiXcb/47nfve+8mvPhNAXrSOd1wjSmuKf4f2sx5fk8awBHgj4AEGJ8EgAbcCwD2B7np8/hOHliegSHZuQuBNzSApLLmgBVAd3Ze//8GSv3eVwHvAC7IDF0AzJ50Tx2w64HVwFuAtgykP3jGeC/SZQCeBa4G/gzYlrGgADwOpA333wVc0/A9//+SjY2s/Z1oigImgAPAssyNmoGjwDqgCuQyZrw8A6Qf+GaD3shv2dhz3VNnrWlw73N+6XxczmXsuAoIgaeAUWAGsCZzJwc8A/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0m5/vXlqknub+80r/6fZsSgG3/sHKh9byPeca8u7ngMxE5p7RxSitPaZ0t3iqCwLBnz1Cy5fHdnpfPqyR2pKnUxjmp2CQVbVCqGjvGKvbXu4ar/7vveLoDMLMM/oQlKdcMaUzfXyiln2rvsv8EVF/K/33OrjWC4t5VRmUT3c988vqrtKf/S1POu0sbQyWRVGulUMpkoMiOXcdk++Z92gvzJLElteJsitKgqrEwVrGb95yo3r9uIN4GSJfBL1nSSg2Msxl9NmAmtzSrnqy+tKmDc0anvlR60H2s0pf/h76ngNdu/cdX3KGUfLy14F0TW0isS0AZZ1E2tQmoMMtHVaCVjpRwspxu2z0Urftxf7QVsDMMTSmkJyzxWepgVUP6Pjnspg0jszpISQZI9KKXOF7KtnbtarN6+wqp175s++yNd6Olp705WDRRtSitk63bj8reXYNeLgx1FDtGy+nu3ceih3p3V7YAtk0ToHBjljQDw01620nW4qxF2ZuvZsf1Fk9ikTvvdZ/fxta4dvSrz7wi36rN3yrF37U3B62PPXWYQ/uOU0z1ke2D5fXf3VbZAiRtGt9o0pH0lIGVrJWyVm5o9XsapwnOn/H8njYBtenLK726GD/+yWtmt+ZzH3vi6cFbH964f8M3d9pfAcMdhrTNp7i/ylj2x4JSBkbdaPcS7BP+EDcR1JNfXtn4d9zCeb7Ms7WXvP0fVkUKEGhETG4AAAAASUVORK5CYII">
<span id="logo-text" class="bold italic align-top">Apertium</span>
</a>
<div class="flex flex-center right">
<input id="search" type="search" class="field display-none mb0 mr3 md-show" autocomplete="language" placeholder="Search 🔎">
<a href="#" target="_blank" rel="noopener" id="github-link">
<img id="github-logo" class="mr3" alt="GitHub" height="55" width="55" src="https://upload.wikimedia.org/wikipedia/commons/9/91/Octicons-mark-github.svg">
</a>
</div>
<hr class="my1 mr3 mb0">
</div>
<div id="content">
<h1 id="loading" class="m1 center display-none">⌛</h1>
<div id="topics" class="flex flex-wrap col-12 mt1"></div>
</div>
<a class="fixed right-0 bottom-0 mr2 mb2 text-decoration-none h2" id="refresh" href="#">🔄</a>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/zepto.js" integrity="sha384-Cp3V2nlfJJ5aA0ctd1PkfNAEMkXM0EGa6RrmEgiv8D6TCaeZJfUFs/PYfR+B5F5H" crossorigin="anonymous"></script>
<script type="text/javascript">
const ORGANIZATION = 'apertium',
CACHE_KEY = `${ORGANIZATION}-cache`,
EXPIRY_KEY = `${ORGANIZATION}-expiry`,
EXPIRY_MILLIS = 60000,
TOPICS = ['languages', 'trunk', 'staging', 'nursery', 'incubator', 'tools'].map(topic => ({
topic: `apertium-${topic}`,
name: topic,
repoUrl: `https://github.com/${ORGANIZATION}/apertium-${topic}`,
}));
async function getReposByTopic(organization) {
const headers = new Headers({ Accept: 'application/vnd.github.mercy-preview+json' });
const cacheStale = !(CACHE_KEY in localStorage) || localStorage[EXPIRY_KEY] < Date.now();
function _fetchRepos(page) {
const url = `https://api.github.com/orgs/${ORGANIZATION}/repos?page=${page}&per_page=100`;
return fetch(url, { headers });
}
let reposByTopic = {};
function _addRepos(repos) {
repos.forEach(repo => {
repo.topics.forEach(topic => {
const repoTopics = reposByTopic[topic] || [];
repoTopics.push(repo);
reposByTopic[topic] = repoTopics;
});
});
}
if (cacheStale) {
console.warn('Repository list cache stale, updating.');
const response = await _fetchRepos(1);
_addRepos(await response.json());
const linkHeader = response.headers.get('Link');
const links = linkHeader ? linkHeader.split(',').map(x => x.split('; ')) : [];
const lastPage = links.length ? parseInt(links.find(([_, rel]) => rel === 'rel="last"')[0].match(/page=(\d+)/)[1]) : 1;
const remainingPages = [...Array(lastPage + 1).keys()].slice(2);
const responses = await Promise.all(remainingPages.map(_fetchRepos));
const reposs = await Promise.all(responses.map(response => response.json()));
reposs.forEach(_addRepos);
localStorage[CACHE_KEY] = JSON.stringify(reposByTopic);
localStorage[EXPIRY_KEY] = Date.now() + EXPIRY_MILLIS;
} else {
reposByTopic = JSON.parse(localStorage[CACHE_KEY]);
}
return Promise.resolve(reposByTopic);
}
async function showTopics() {
$('#topics, #loading').toggleClass('display-none');
const reposByTopic = await getReposByTopic(ORGANIZATION);
const normalizedSearchText = $('#search')
.val()
.toLowerCase();
$('.topic').remove();
TOPICS.forEach(({ topic, name, repoUrl }, i) => {
const repoList = $('<ul class="repos list-reset mt0 relative">');
$('#topics').append(
$('<div class="topic flex-auto">').append(
$('<div>').append(
$('<h2 class="inline-block m0">').text(name),
$('<a class="ml1 text-decoration-none" target="_blank" rel="noopener">🔗</a>', {
href: repoUrl,
}),
$('<hr class="mr0 ml0 col-10">'),
),
repoList,
),
);
const repos = reposByTopic[topic] || [];
repos
.sort((a, b) => a.name.localeCompare(b.name))
.filter(
({ name, description }) =>
name.toLowerCase().includes(normalizedSearchText) ||
(description && description.toLowerCase().includes(normalizedSearchText)),
)
.forEach(({ name, description, html_url }) =>
repoList.append(
$('<li class="repo">').append(
$(`<a rel="noopener" target="_blank">`, {
href: html_url,
class: description ? `hint--${i === TOPICS.length - 1 ? 'left' : 'right'}` : null, // hack :\
'aria-label': description,
}).append(
$('<code class="p0 h4">').html(
normalizedSearchText ? name.replace(normalizedSearchText, match => `<b>${match}</b>`) : name,
),
),
),
),
);
});
$('#topics, #loading').toggleClass('display-none');
}
function refreshTopics() {
localStorage.clear();
showTopics();
}
function showSearchInput() {
$('#search')
.removeClass('display-none')
.focus();
}
function refreshLayout() {
$("#content").height($(window).height() - $("#navbar").height() - 40);
$(".repos").each(function (index) {
if ($(this).position().top >= $(window).height() - 20) {
$(this).css("top", "14px");
$(this).prev().addClass("sticky-bottom").removeClass("sticky");
} else {
$(this).css("top", "0px");
$(this).prev().removeClass("sticky-bottom").addClass("sticky").css("width", "100%");
}
});
const stickyWidthMap = { 1: "95.5", 2: "47.5", 3: "32" };
$(".sticky-bottom").css("width", `${stickyWidthMap[$(".sticky-bottom").length] || 100}%`);
}
$(document).ready(() => {
$('#github-link').attr('href', `https://github.com/${ORGANIZATION}`);
$('#refresh').click(({ currentTarget }) => {
currentTarget.blur();
refreshTopics();
});
$('#search').on('input', showTopics);
$(document.body).keypress(({ target, altKey, ctrlKey, metaKey, key }) => {
if (target === document.body && !altKey && !ctrlKey && !metaKey) {
showSearchInput();
}
});
$(window).keydown(event => {
const { keyCode, ctrlKey, metaKey } = event;
if (keyCode === 114 || ((ctrlKey || metaKey) && keyCode === 70)) {
event.preventDefault();
showSearchInput();
}
});
setInterval(refreshTopics, EXPIRY_MILLIS * 2);
setInterval(refreshLayout, 1);
showTopics();
});
</script>
</body>
</html>