summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Shangreaux <grant@unabridgedsoftware.com>2020-12-29 13:15:21 -0600
committerGrant Shangreaux <grant@unabridgedsoftware.com>2020-12-29 13:15:21 -0600
commit7e34cbaacf679fb0683751d6adfe731b225a7754 (patch)
tree57533aaf6fab9aed952336a33c0b49b97017468a
parent0fd8e72b8249e9001aa7119c7df4baa6d1d2909b (diff)
downloademacsconf-wiki-7e34cbaacf679fb0683751d6adfe731b225a7754.tar.xz
emacsconf-wiki-7e34cbaacf679fb0683751d6adfe731b225a7754.zip
Clean: add ES6 modernizations to video jump script
Diffstat (limited to '')
-rw-r--r--templates/page.tmpl14
1 files changed, 7 insertions, 7 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl
index 1b694bd5..3f3044a9 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -65,22 +65,22 @@
This could be extended to accept hours in the time stamp as well, but currently does not.
*/
- var mainVideo;
- var timestamps;
+ let mainVideo;
+ let timestamps;
// expects a string like "mm:ss"
function parseSeconds(timeString) {
- times = timeString.split(":");
- minutes = parseFloat(times[0]);
- seconds = parseFloat(times[1]);
+ const times = timeString.split(":");
+ const minutes = parseFloat(times[0]);
+ const seconds = parseFloat(times[1]);
return (minutes * 60) + seconds;
}
window.onload = function initScript() {
mainVideo = document.getElementById("mainVideo");
timestamps = document.getElementsByClassName("time-link");
- len = timestamps.length;
- for (i = 0; i < len; i++) {
+ let len = timestamps.length;
+ for (let i = 0; i < len; i++) {
timestamps[i].onclick = function () {
mainVideo.currentTime = parseSeconds(this.innerText)
};