diff options
author | Sacha Chua <sacha@sachachua.com> | 2024-12-22 20:35:09 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2024-12-22 20:35:09 -0500 |
commit | 49b7eb901ed7ad953d41d43358dec13ef3e1a9d2 (patch) | |
tree | 489f171281e46fdd18adfe0dbc3ad559adbf0e20 /templates/page.tmpl | |
parent | 12ba5fe5f5a1efcd4d7a4104727da78da4705055 (diff) | |
download | emacsconf-wiki-49b7eb901ed7ad953d41d43358dec13ef3e1a9d2.tar.xz emacsconf-wiki-49b7eb901ed7ad953d41d43358dec13ef3e1a9d2.zip |
hah, it turns out I swapped the IDs in JS
Diffstat (limited to 'templates/page.tmpl')
-rw-r--r-- | templates/page.tmpl | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl index 906e246a..f74e9e2b 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -65,9 +65,7 @@ This could be extended to accept hours in the time stamp as well, but currently does not. */ - let mainVideo; - let qnaVideo; // some pages have a questions and answers video - let timestamps; + let timestamps; // expects a string like "mm:ss.mmm" function parseSeconds(timeString) { @@ -79,10 +77,6 @@ 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); @@ -94,22 +88,10 @@ } window.onload = function initScript() { - mainVideo = document.getElementById("mainVideo"); - qnaVideo = document.getElementById("qnaVideo"); - timestamps = document.getElementsByClassName("time-link"); - var len = timestamps.length; - for (let i = 0; i < len; i++) { - timestamps[i].onclick = function () { - videoType = this.href.split("/").pop(); - video = (videoType == "#mainVideo") ? mainVideo : qnaVideo; - video.currentTime = parseSeconds(this.innerText) - }; - } let subtitles = document.getElementsByClassName('subtitle'); for (let i = 0; i < subtitles.length; i++) { subtitles[i].onclick = handleSubtitleClick; } - } // @license-end </script> |