-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoftware.html
More file actions
85 lines (78 loc) · 2.86 KB
/
Copy pathsoftware.html
File metadata and controls
85 lines (78 loc) · 2.86 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Software — Unary Lab</title>
<meta name="description" content="Open-source software and artifacts 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="software-root">
<p class="placeholder-msg">Loading…</p>
</div>
</div>
</main>
<script src="js/utils.js?v=1"></script>
<script>
function renderSoftwareItem(p) {
const dateDisplay = formatNewsDate(p.date);
const links = [bracketLink(p._paper, 'paper'), bracketLink(p.code, 'code')]
.filter(Boolean).join(' ');
const awards = renderAwards(p);
const thumb = p._thumb
? `<iframe src="${esc(p._thumb)}#toolbar=0&navpanes=0" title="${esc(p.software)}"
scrolling="no" class="software-thumb-pdf"></iframe>`
: '';
return `
<li class="software-item">
<div class="software-thumb">${thumb}</div>
<div class="software-info">
<div class="software-name">${esc(p.software)}</div>
<div class="software-venue"><em>${esc(p.venue)}</em>${dateDisplay ? `, ${dateDisplay}` : ''}</div>
<div class="software-desc">${esc(p.description)}</div>
${links ? `<div class="pub-links">${links}</div>` : ''}
${awards}
</div>
</li>`;
}
document.addEventListener('DOMContentLoaded', async () => {
try {
const [rawPubs, manifest] = await Promise.all([
loadCSV('data/publication.csv'),
loadFileManifest(),
]);
const filtered = rawPubs.filter(p =>
p.software && p.software.trim() && p.description && p.description.trim()
);
const software = sortDescByDate(filtered.map(p => ({
...p,
_paper: resolvePubLinks(p['paper/slide/poster'], manifest)._paper,
_thumb: resolveFile(manifest, 'software', `${p.software}.pdf`),
})));
const root = document.getElementById('software-root');
if (software.length === 0) {
root.innerHTML = `<h1 class="page-title">Software</h1>${placeholder('No software listed yet.')}`;
} else {
root.innerHTML = `<h1 class="page-title">Software</h1><ul class="software-list">${software.map(renderSoftwareItem).join('')}</ul>`;
root.querySelectorAll('.software-thumb').forEach(thumb => {
const iframe = thumb.querySelector('iframe');
if (!iframe) return;
thumb.style.cursor = 'zoom-in';
thumb.addEventListener('click', () => {
if (window.openLightbox) window.openLightbox(iframe.src);
});
});
}
} catch (e) {
document.getElementById('software-root').innerHTML = placeholder('Could not load software data.');
console.error(e);
}
});
</script>
</body>
</html>