Repository navigation
Expand file tree
/
Copy pathpublication.html
More file actions
67 lines (61 loc) · 2.04 KB
/
Copy pathpublication.html
File metadata and controls
67 lines (61 loc) · 2.04 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Publication — Unary Lab</title>
<meta name="description" content="Publications from Unary Lab (Di Wu, UCF ECE).">
<link rel="icon" href="file/logo/unary-logo-black.svg" type="image/svg+xml">
<link rel="stylesheet" href="css/style.css?v=1">
</head>
<body>
<div id="nav-placeholder"></div>
<main>
<div class="container">
<div id="pub-root">
<p class="placeholder-msg">Loading…</p>
</div>
</div>
</main>
<script src="js/utils.js?v=1"></script>
<script>
function groupByYear(pubs) {
const map = {};
pubs.forEach(p => {
const d = parseNewsDate(p.date);
const yr = d ? d.getFullYear().toString() : 'Unknown';
(map[yr] = map[yr] || []).push(p);
});
return map;
}
function renderGrouped(pubs) {
if (pubs.length === 0) return placeholder('No publications.');
const grouped = groupByYear(sortDescByDate(pubs));
const years = Object.keys(grouped).sort((a, b) => b - a);
return years.map(yr => `
<div class="year-header">${esc(yr)}</div>
<ul class="pub-list">${grouped[yr].map(renderPubItem).join('')}</ul>
`).join('');
}
document.addEventListener('DOMContentLoaded', async () => {
try {
const [rawPubs, manifest] = await Promise.all([
loadCSV('data/publication.csv'),
loadFileManifest(),
]);
const allPubs = rawPubs.map(p => ({ ...p, ...resolvePubLinks(p['paper/slide/poster'], manifest) }));
const selectedPubs = allPubs.filter(p =>
['1','true','yes'].includes((p.selected || '').toLowerCase().trim())
);
setupTabs(document.getElementById('pub-root'), [
{ id: 'selected', label: 'Selected Publications', html: () => renderGrouped(selectedPubs) },
{ id: 'full', label: 'Full Publications', html: () => renderGrouped(allPubs) },
], 'selected');
} catch (e) {
document.getElementById('pub-root').innerHTML = placeholder('Could not load publications.');
console.error(e);
}
});
</script>
</body>
</html>