From 7a3328f5f309f06b133ecab0214a44b2bda56be3 Mon Sep 17 00:00:00 2001 From: HeNine <> Date: Sat, 13 Nov 2021 08:38:05 +0100 Subject: [PATCH] show line context --- buscribe-web/line.less | 7 +++++++ buscribe-web/script.js | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/buscribe-web/line.less b/buscribe-web/line.less index c86646d..21e047d 100644 --- a/buscribe-web/line.less +++ b/buscribe-web/line.less @@ -60,6 +60,13 @@ grid-column: text; } + + a { + font-size: small; + font-family: @sans-serif; + color: lightgray; + text-align: right; + } } .line.verified { diff --git a/buscribe-web/script.js b/buscribe-web/script.js index b7524e7..ad9bcde 100644 --- a/buscribe-web/script.js +++ b/buscribe-web/script.js @@ -59,6 +59,7 @@ function fillResults(results) {
${line.speakers == null ? "" : line.speakers.join(", ")}
${line.start_time}
${line.text}
+ Show context `; @@ -74,4 +75,23 @@ function switchToUTC() { function switchToBus() { document.getElementById("start_time").type = "text"; document.getElementById("end_time").type = "text"; +} + +function showContext(time) { + + let start_time = new Date(time + "Z"); + start_time.setMinutes(start_time.getMinutes() - 3); + let start_time_string = start_time.toISOString(); + start_time_string = start_time_string.substring(0, start_time_string.length - 1) + + let end_time = new Date(time + "Z"); + end_time.setMinutes(end_time.getMinutes() + 3); + let end_time_string = end_time.toISOString(); + end_time_string = end_time_string.substring(0, end_time_string.length - 1) + + document.getElementById("start_time").value = start_time_string; + document.getElementById("end_time").value = end_time_string; + document.getElementById("search_text").value = ""; + + doSearch(); } \ No newline at end of file