From c23c3d84373f0fa52d680014100c4b7c3edf9b50 Mon Sep 17 00:00:00 2001 From: Astrid Smith Date: Sat, 17 Sep 2016 17:47:02 -0700 Subject: more things --- index.html | 75 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 23 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index f1a4159..0276156 100644 --- a/index.html +++ b/index.html @@ -2,10 +2,8 @@
- - @@ -30,14 +28,15 @@ function onlyUnique(value, index, self) { // - s is a start time in decimal seconds // - e is an end time in decimal seconds function frag_make(cutlist) { - var vid_list = cutlist.map(function(x) {return x.id}).filter(onlyUnique); + var vid_list = cutlist.map(function(x) {return x.id}).concat([video_id]).filter(onlyUnique); var cuts = cutlist.map(function(x) { return {id: vid_list.indexOf(x.id), start: x.start, end: x.end}}); var frag = vid_list.join(",") + ":" + - cuts.map(function(x) { return [x.id, x.start, x.end].join("-") }).join(","); + cuts.map(function(x) { return [x.id, x.start, x.end].join("-") }).join(",") + ":" + + ($("#repeat-p")[0].checked ? "r" : ""); return frag; } @@ -45,10 +44,13 @@ function frag_make(cutlist) { // read a URL fragment string and turn it into a cutlist function frag_parse(frag) { var vc - vc = frag.split(":"); + vc = (frag + "::").split(":"); var vids = vc[0].split(","); var cuts = vc[1].split(","); + var flags = vc[2].split(""); + $("#repeat-p")[0].checked = (flags.indexOf("r") != -1); + var cutlist = cuts.map(function(x) { ise = x.split("-"); return {id:vids[+ise[0]], start:+ise[1], end:+ise[2]}; }) return cutlist; @@ -73,16 +75,18 @@ function frag_parse(frag) {| start | end |
|---|---|
| from | to |