diff options
author | Mango0x45 <thomasvoss@live.com> | 2021-03-17 15:50:30 +0100 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2021-03-17 15:50:30 +0100 |
commit | 971d279043e45c555d36502ae2bbaed2b81c2806 (patch) | |
tree | 1c4618f6d395bb3dadc7cf6483c7002dc13ba321 | |
parent | d5c9ebfe4e548d2aa7146045a9bc38d115a98a1d (diff) |
Buttons are bloat
-rw-r--r-- | index.html | 6 | ||||
-rw-r--r-- | main.js | 12 |
2 files changed, 14 insertions, 4 deletions
@@ -38,12 +38,12 @@ <input type="text" id="endobj" style='width:100%' onchange='parse_time(event)'> </p> <h3 id="video-time">Video Time</h3> - <button id="compute_button" onclick="compute()">Compute time</button> <input type="text" id="time" readonly - size="20"> + <input type="text" id="time" readonly size="20"> <p> <textarea id="mod_message" cols="40" rows="5" disabled></textarea> </p> - <button id="mod_message_button" onclick="copy_mod_message()" disabled>Copy Mod Message to Clipboard</button> + <button id="mod_message_button" onclick="copy_mod_message()" disabled>Copy Mod Message to + Clipboard</button> </div> </body> @@ -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(); } |