fix user instruction + add enter-key event listener

This commit is contained in:
Paul Lesur 2024-07-31 19:51:35 +02:00
parent e801e2d9b9
commit e96af15a61

View file

@ -4,11 +4,19 @@ title: Runaway Planning Results
{{< dummy >}} {{< dummy >}}
<input type="number" id="resultId" min="0" max="99" default="0"> <h2>
<input type="submit" id="showResultButton"> Please enter a number in the field below, and press enter. The corresponding
dataset will be loaded.
</h2>
<p>If the video does not load for a given algorithm, that means it failed to <input type="number" id="resultId" min="0" max="99" default="0" />
compute a solution (within the 10s timeout).</p> <input type="submit" id="showResultButton" value="Load dataset" />
<h3>
If the video does not load for a given algorithm, that means it failed to
compute a solution (within the 10s timeout).
</h3>
<div> <div>
<p>Raw CBS</p> <p>Raw CBS</p>
@ -35,6 +43,7 @@ compute a solution (within the 10s timeout).</p>
var idField = document.getElementById("resultId"); var idField = document.getElementById("resultId");
var button = document.getElementById("showResultButton"); var button = document.getElementById("showResultButton");
button.addEventListener("click", () => show_all_videos(idField.value)); button.addEventListener("click", () => show_all_videos(idField.value));
idField.addEventListener("keypress", (event) => event.key === "Enter" && button.click());
function show_one_video(videoDiv, n) { function show_one_video(videoDiv, n) {
const videoLoc = "./" + videoDiv.id + "/from_generated_" + n + ".mp4"; const videoLoc = "./" + videoDiv.id + "/from_generated_" + n + ".mp4";