From 7ad6dec786c53a99a5995445c4ef1c38d8c54bbe Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 28 Jul 2019 17:45:48 +0000 Subject: [PATCH 1/4] assets/scripts.js: Fix comparing to strings in preconditions --- assets/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts.js b/assets/scripts.js index 1c0585c..482d683 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -32,7 +32,7 @@ function preconditionToJS(cond) { } else if (cond === true) { return true; } else if (typeof cond === 'string') { - return cond; + return JSON.stringify(cond); } else { console.log('unsupported condition!', cond); return 'true'; From e9a9719f21774feca4aef285ce4dfcd2c40f3f6e Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 28 Jul 2019 17:52:23 +0000 Subject: [PATCH 2/4] Add Unlicense header to source files As per https://github.com/joric/bandersnatch/commit/f3a58d84bf04e8984142945daf225d27906d7379 --- assets/scripts.js | 27 +++++++++++++++++++++++++++ assets/styles.css | 27 +++++++++++++++++++++++++++ index.html | 28 ++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff --git a/assets/scripts.js b/assets/scripts.js index 482d683..a2739c3 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -1,3 +1,30 @@ +/* + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * For more information, please refer to + */ + // Data var segmentMap = SegmentMap; var bv = bandersnatch.videos['80988062'].interactiveVideoMoments.value; diff --git a/assets/styles.css b/assets/styles.css index 4beec05..3a8acb7 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -1,3 +1,30 @@ +/* + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * For more information, please refer to + */ + body { margin: auto; text-align: center; diff --git a/index.html b/index.html index d8e3d9b..58b9c70 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,32 @@ + + + From 96908eb3af6436a83b9b0195c75311b6b5083fc0 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 28 Jul 2019 18:02:52 +0000 Subject: [PATCH 3/4] assets/scripts.js: Fix jumping forward while paused --- assets/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts.js b/assets/scripts.js index a2739c3..3487867 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -380,7 +380,7 @@ function jumpForward() { let moments = momentsBySegment[segmentId] || []; // Find the earliest moment within this segment after cursor for (let m of moments) - if (m.startMs >= ms && (interactionMs == 0 || m.startMs < interactionMs)) + if (m.startMs > ms && (interactionMs == 0 || m.startMs < interactionMs)) interactionMs = m.startMs; if (interactionMs) { From ad877dfe1e4af16df785be54418cb926c8689b50 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 28 Jul 2019 18:05:30 +0000 Subject: [PATCH 4/4] assets/scripts.js: Make left/right arrow seeks "natural" Unbreaks jumping to/past first choice with empty localStorage. --- assets/scripts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/scripts.js b/assets/scripts.js index 3487867..bf0b652 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -383,6 +383,7 @@ function jumpForward() { if (m.startMs > ms && (interactionMs == 0 || m.startMs < interactionMs)) interactionMs = m.startMs; + segmentTransition = true; if (interactionMs) { seek(interactionMs); } else { @@ -406,6 +407,7 @@ function jumpBack() { inMoment = true; } + segmentTransition = true; if (interactionMs) { seek(interactionMs); } else if (inMoment) {