Fix View Video button and restore View Images button

This commit is contained in:
2025-12-28 11:02:33 +11:00
parent 0419bd6a9e
commit 7dba6a8183
2 changed files with 20 additions and 2 deletions

View File

@@ -167,9 +167,12 @@
<a href="#" id="view-waterfall" class="button" style="display: inline-block; padding: 0.75rem 1.5rem; background: var(--color-accent); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; margin-right: 1rem;"> <a href="#" id="view-waterfall" class="button" style="display: inline-block; padding: 0.75rem 1.5rem; background: var(--color-accent); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; margin-right: 1rem;">
📊 View Waterfall Chart 📊 View Waterfall Chart
</a> </a>
<a href="#" id="view-video" class="button" style="display: inline-block; padding: 0.75rem 1.5rem; background: var(--color-accent); color: white; text-decoration: none; border-radius: 8px; font-weight: 600;"> <a href="#" id="view-video" class="button" style="display: inline-block; padding: 0.75rem 1.5rem; background: var(--color-accent); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; margin-right: 1rem;">
🎥 View Video 🎥 View Video
</a> </a>
<a href="#" id="view-images" class="button" style="display: inline-block; padding: 0.75rem 1.5rem; background: var(--color-accent); color: white; text-decoration: none; border-radius: 8px; font-weight: 600;">
🖼️ View Image Gallery
</a>
</div> </div>
<!-- Content Breakdown --> <!-- Content Breakdown -->

15
main.js
View File

@@ -163,7 +163,22 @@ function displayResults(data) {
}; };
document.getElementById('view-video').onclick = (e) => { document.getElementById('view-video').onclick = (e) => {
e.preventDefault(); e.preventDefault();
if (data.filmstrip && data.filmstrip.length > 0) {
openVideoModal(data.filmstrip); openVideoModal(data.filmstrip);
} else {
alert('No video data available for this test.');
}
};
document.getElementById('view-images').onclick = (e) => {
e.preventDefault();
if (data.filmstrip && data.filmstrip.length > 0) {
// Open images.html?id=... (Assuming logic exists, user requested it back)
// Or reusing filmstrip display? User said "View Images function".
// Checking previous code: it opened `/images.html?id=${data.id}`
window.open(`/images.html?id=${data.id}`, '_blank');
} else {
alert('No images available.');
}
}; };
} }