From 6de4c373099fc24100fe8bcfd63d2677f4018035 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 27 Jan 2021 00:53:29 -0500 Subject: Try subtitle --- templates/page.tmpl | 9 ++++----- templates/subtitle.md | 1 - templates/subtitle.tmpl | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 templates/subtitle.md create mode 100644 templates/subtitle.tmpl (limited to 'templates') diff --git a/templates/page.tmpl b/templates/page.tmpl index 576f3d66..44b6a957 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -69,12 +69,11 @@ let qnaVideo; // some pages have a questions and answers video let timestamps; - // expects a string like "mm:ss" + // expects a string like "mm:ss.mmm" function parseSeconds(timeString) { - const times = timeString.split(":"); - const minutes = parseFloat(times[0]); - const seconds = parseFloat(times[1]); - return (minutes * 60) + seconds; + return timeString.split(":").reduce(function(prev, o) { + return prev * 60 + parseFloat(o); + }); } window.onload = function initScript() { diff --git a/templates/subtitle.md b/templates/subtitle.md deleted file mode 100644 index dcd6971e..00000000 --- a/templates/subtitle.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/subtitle.tmpl b/templates/subtitle.tmpl new file mode 100644 index 00000000..dcd6971e --- /dev/null +++ b/templates/subtitle.tmpl @@ -0,0 +1 @@ + -- cgit v1.2.3