From 971d279043e45c555d36502ae2bbaed2b81c2806 Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Wed, 17 Mar 2021 15:50:30 +0100 Subject: Buttons are bloat --- index.html | 6 +++--- main.js | 12 +++++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index dc241b4..5a9063e 100644 --- a/index.html +++ b/index.html @@ -38,12 +38,12 @@

Video Time

-   +

- + diff --git a/main.js b/main.js index dc7ca6d..da3d68f 100644 --- a/main.js +++ b/main.js @@ -71,7 +71,13 @@ function check_fps(event) /* Get current frame from input field (either start time or end time) */ function parse_time(event) { - let inptext_frame = (JSON.parse(event.target.value)).cmt; + try { + inptext_frame = (JSON.parse(event.target.value)).cmt; + } catch { + document.getElementById(event.target.id).value = ""; + return; + } + if (inptext_frame !== undefined) { const fps = parseInt( document.getElementById("framerate").value); @@ -79,4 +85,8 @@ function parse_time(event) const fframe = frame_from_obj(inptext_frame, fps); document.getElementById(event.target.id).value = `${fframe}`; } + + if (document.getElementById("startobj").value + && document.getElementById("endobj").value) + compute(); } -- cgit v1.2.3