From 0150f653898aaaa888a8d0cca4cdd6b361f761f2 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sat, 2 Dec 2023 13:14:00 -0500 Subject: fix clickable captions, derp --- templates/page.tmpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/page.tmpl b/templates/page.tmpl index 33885246..1f40aa66 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -76,9 +76,13 @@ }, 0); } - function handleSubtitleClick(event) { - var video = event.target.attributes['data-video'].value; - var start = event.target.attributes['data-start'].value + function handleSubtitleClick(event) { + var video = event.target.getAttribute('data-video'); + var start = event.target.getAttribute('data-start'); + let m = video.match(/(mainVideo|qnaVideo)-(.*)/); + if (m) { + video = m[2] + '-' + m[1]; + } var videoElem = document.getElementById(video); if (videoElem) { videoElem.currentTime = parseSeconds(start); -- cgit v1.2.3