Skip to content

Commit 414970d

Browse files
committed
improved index.js to reduce its bloat
1 parent ebfa15b commit 414970d

3 files changed

Lines changed: 21 additions & 46 deletions

File tree

assets/js/index.js

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,21 @@ document.addEventListener('DOMContentLoaded', function () {
88
if (milestoneModal) {
99
milestoneModal.addEventListener('show.bs.modal', function (event) {
1010
var triggerElement = event.relatedTarget;
11-
12-
// Check if this is a milestone link with data-milestone-id attribute
1311
var milestoneId = triggerElement.getAttribute('data-milestone-id');
12+
var col = milestoneId ? document.getElementById(milestoneId)?.closest('.col') : triggerElement.closest('.col');
1413

15-
if (milestoneId) {
16-
// This is a milestone link - find the anchor with matching ID
17-
var anchor = document.getElementById(milestoneId);
18-
if (anchor) {
19-
var col = anchor.closest('.col');
20-
if (col) {
21-
var colClone = col.cloneNode(true);
22-
// title - use button text
23-
var buttonText = triggerElement.textContent.trim();
24-
document.getElementById('milestoneModalLabel').textContent =
25-
buttonText || 'Milestone Details';
26-
// content
27-
var modalBody = document.getElementById('milestoneModalBody');
28-
modalBody.innerHTML = '';
29-
modalBody.appendChild(colClone);
30-
// cleanup duplicate header
31-
var headerInClone = colClone.querySelector('.card-header');
32-
if (headerInClone) {
33-
headerInClone.remove();
34-
}
35-
return; // Found and processed the milestone
36-
}
37-
}
38-
} else {
39-
// This is a direct milestone button click - use original logic
40-
var col = triggerElement.closest('.col');
41-
if (col) {
42-
var colClone = col.cloneNode(true);
43-
// title - use button text
44-
var buttonText = triggerElement.textContent.trim();
45-
document.getElementById('milestoneModalLabel').textContent =
46-
buttonText || 'Milestone Details';
47-
// content
48-
var modalBody = document.getElementById('milestoneModalBody');
49-
modalBody.innerHTML = '';
50-
modalBody.appendChild(colClone);
51-
// cleanup duplicate header
52-
var headerInClone = colClone.querySelector('.card-header');
53-
if (headerInClone) {
54-
headerInClone.remove();
55-
}
56-
}
14+
if (col) {
15+
var colClone = col.cloneNode(true);
16+
var buttonText = triggerElement.textContent.trim();
17+
document.getElementById('milestoneModalLabel').textContent = buttonText || 'Milestone Details';
18+
var modalBody = document.getElementById('milestoneModalBody');
19+
modalBody.innerHTML = '';
20+
modalBody.appendChild(colClone);
21+
var headerInClone = colClone.querySelector('.card-header');
22+
if (headerInClone) headerInClone.remove();
5723
}
5824
});
59-
// clear content when modal closes
25+
6026
milestoneModal.addEventListener('hidden.bs.modal', function () {
6127
document.getElementById('milestoneModalLabel').textContent = '';
6228
document.getElementById('milestoneModalBody').innerHTML = '';

public/js/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

view/app/new.tmpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@
77
{{- $padding := "p-0 m-0 px-5 pb-1" }}
88
<h4 class="index-section-header index-section-header-alt">Early-Mid 2026</h4>
99
<div class="index-intro-section index-intro-section-alt">
10+
<p>
1011
Added comprehensive support for PCBoard files. While these have always existed on the site, they can now be filtered and viewed on their own pages -
1112
either as a <a href="/files/pcboard">PCBoard&nbsp;collection</a>, as <a href="/files/pcboard-ppe">PPE&nbsp;tools</a> and applications,
1213
or as <a href="/files/pcboard-text">color&nbsp;text&nbsp;files</a> using <code>@X</code> codes.
1314
Finally, these <code>@X</code> codes are now rendered as colored text in the <em>readme or information text</em> sections.
15+
</p>
16+
<p>
17+
The user-interface of the <a href="/">Intertwined milestones of the PC industry and the Scene</a> has been improved.
18+
Clicking either the highlight buttons or the milestone dates will pop up a modal with the content for easier readability.
19+
</p>
20+
<p>
21+
And finally, a long requested feature, <a href="/api">we can offer</a> a RESTful API in JSON.
22+
</p>
1423
</div>
1524
<h4 class="index-section-header index-section-header-alt">Early 2026</h4>
1625
<div class="index-intro-section index-intro-section-alt">

0 commit comments

Comments
 (0)