summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/page.tmpl9
-rw-r--r--templates/subtitle.tmpl (renamed from templates/subtitle.md)0
2 files changed, 4 insertions, 5 deletions
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.tmpl
index dcd6971e..dcd6971e 100644
--- a/templates/subtitle.md
+++ b/templates/subtitle.tmpl