Use more native HTML options for editor keyboard shortcuts help

pull/298/head
ElementalAlchemist 2 years ago committed by Mike Lang
parent ffae321d04
commit 1cb819a4c5

@ -20,6 +20,38 @@
</head>
<body>
<div id="errors"></div>
<div id="page-container">
<details id="editor-help">
<summary>Keyboard Shortcuts</summary>
<ul>
<li>Number keys (0-9): Jump to that 10% interval of the video (0% - 90%)</li>
<li>K or Space: Toggle pause</li>
<li>M: Toggle mute</li>
<li>J: Back 10 seconds</li>
<li>L: Forward 10 seconds</li>
<li>Left arrow: Back 5 seconds</li>
<li>Right arrow: Forward 5 seconds</li>
<li>Shift+J: Back 1 second</li>
<li>Shift+L: Forward 1 second</li>
<li>Comma (,): Back 1 frame</li>
<li>Period (.): Forward 1 frame</li>
<li>Equals (=): Increase playback speed one step</li>
<li>Hyphen (-): Decrease playback speed one step</li>
<li>Shift+=: Maximum playback speed</li>
<li>Shift+-: Minimum playback speed</li>
<li>Backspace: Reset playback speed to 1x</li>
<li>
Left bracket ([): Set start point for active range (indicated by arrow) to active video
time
</li>
<li>Right bracket (]): Set end point for active range to active video time</li>
<li>O: Set active range one above current active range</li>
<li>
P: Set active range one below current active range, adding a new range if the current
active range is the last one
</li>
</ul>
</details>
<form id="stream-time-settings">
<div>
<span class="field-label">Stream</span>
@ -45,7 +77,11 @@
<div id="video-controls">
<div id="video-controls-bar">
<div>
<img id="video-controls-play-pause" src="images/video-controls/play.png" class="click" />
<img
id="video-controls-play-pause"
src="images/video-controls/play.png"
class="click"
/>
</div>
<div id="video-controls-time">
<span id="video-controls-current-time"></span>
@ -84,42 +120,6 @@
<div id="waveform-marker"></div>
</div>
<div id="editor-help">
<a href="#" id="editor-help-link">Help</a>
<div id="editor-help-box" class="hidden">
<a id="editor-help-box-close">[X]</a>
<h2>Keyboard Shortcuts</h2>
<ul>
<li>Number keys (0-9): Jump to that 10% interval of the video (0% - 90%)</li>
<li>K or Space: Toggle pause</li>
<li>M: Toggle mute</li>
<li>J: Back 10 seconds</li>
<li>L: Forward 10 seconds</li>
<li>Left arrow: Back 5 seconds</li>
<li>Right arrow: Forward 5 seconds</li>
<li>Shift+J: Back 1 second</li>
<li>Shift+L: Forward 1 second</li>
<li>Comma (,): Back 1 frame</li>
<li>Period (.): Forward 1 frame</li>
<li>Equals (=): Increase playback speed one step</li>
<li>Hyphen (-): Decrease playback speed one step</li>
<li>Shift+=: Maximum playback speed</li>
<li>Shift+-: Minimum playback speed</li>
<li>Backspace: Reset playback speed to 1x</li>
<li>
Left bracket ([): Set start point for active range (indicated by arrow) to active video
time
</li>
<li>Right bracket (]): Set end point for active range to active video time</li>
<li>O: Set active range one above current active range</li>
<li>
P: Set active range one below current active range, adding a new range if the current
active range is the last one
</li>
</ul>
</div>
</div>
<div>
<input type="checkbox" id="enable-chapter-markers" />
<label for="enable-chapter-markers">Add chapter markers to video description</label>
@ -226,8 +226,12 @@
<div id="download">
<label for="download-type-select">Download type:</label>
<select id="download-type-select">
<option value="rough" selected>Rough (fastest, pads start and end by a few seconds)</option>
<option value="fast">Fast (may have artifacts a few seconds in from start and end)</option>
<option value="rough" selected>
Rough (fastest, pads start and end by a few seconds)
</option>
<option value="fast">
Fast (may have artifacts a few seconds in from start and end)
</option>
<option value="mpegts">MPEG-TS (slow, consumes server resources)</option>
</select>
<a id="download-link">Download Video</a>
@ -253,7 +257,8 @@
<div id="data-correction-force-reset-confirm" class="hidden">
<p>Are you sure you want to reset this event?</p>
<p>
This will set the row back to Unedited and forget about any video that may already exist.
This will set the row back to Unedited and forget about any video that may already
exist.
</p>
<p>
This is intended as a last-ditch effort to clear a malfunctioning cutter, or if a video
@ -277,5 +282,6 @@
<div id="google-auth-sign-in" class="g-signin2" data-onsuccess="googleOnSignIn"></div>
<a href="#" id="google-auth-sign-out" class="hidden">Sign Out of Google Account</a>
</div>
</div>
</body>
</html>

@ -14,6 +14,28 @@
</head>
<body>
<div id="errors"></div>
<div id="page-container">
<details id="editor-help">
<summary>Keyboard Shortcuts</summary>
<ul>
<li>Number keys (0-9): Jump to that 10% interval of the video (0% - 90%)</li>
<li>K or Space: Toggle pause</li>
<li>M: Toggle mute</li>
<li>J: Back 10 seconds</li>
<li>L: Forward 10 seconds</li>
<li>Left arrow: Back 5 seconds</li>
<li>Right arrow: Forward 5 seconds</li>
<li>Shift+J: Back 1 second</li>
<li>Shift+L: Forward 1 second</li>
<li>Comma (,): Back 1 frame</li>
<li>Period (.): Forward 1 frame</li>
<li>Equals (=): Increase playback speed one step</li>
<li>Hyphen (-): Decrease playback speed one step</li>
<li>Shift+=: Maximum playback speed</li>
<li>Shift+-: Minimum playback speed</li>
<li>Backspace: Reset playback speed to 1x</li>
</ul>
</details>
<form id="stream-time-settings">
<div>
<label for="stream-time-setting-stream" class="field-label">Stream</label>
@ -66,7 +88,11 @@
<div id="video-controls">
<div id="video-controls-bar">
<div>
<img id="video-controls-play-pause" src="images/video-controls/play.png" class="click" />
<img
id="video-controls-play-pause"
src="images/video-controls/play.png"
class="click"
/>
</div>
<div id="video-controls-time">
<span id="video-controls-current-time"></span>
@ -99,31 +125,6 @@
<progress id="video-controls-playback-position" value="0" class="click"></progress>
</div>
<div id="editor-help">
<a href="#" id="editor-help-link">Help</a>
<div id="editor-help-box" class="hidden">
<a id="editor-help-box-close">[X]</a>
<h2>Keyboard Shortcuts</h2>
<ul>
<li>Number keys (0-9): Jump to that 10% interval of the video (0% - 90%)</li>
<li>K or Space: Toggle pause</li>
<li>M: Toggle mute</li>
<li>J: Back 10 seconds</li>
<li>L: Forward 10 seconds</li>
<li>Left arrow: Back 5 seconds</li>
<li>Right arrow: Forward 5 seconds</li>
<li>Shift+J: Back 1 second</li>
<li>Shift+L: Forward 1 second</li>
<li>Comma (,): Back 1 frame</li>
<li>Period (.): Forward 1 frame</li>
<li>Equals (=): Increase playback speed one step</li>
<li>Hyphen (-): Decrease playback speed one step</li>
<li>Shift+=: Maximum playback speed</li>
<li>Shift+-: Minimum playback speed</li>
<li>Backspace: Reset playback speed to 1x</li>
</ul>
</div>
</div>
<a href="#" id="download">Download Video</a>
<a href="#" id="time-converter-link">Convert Times</a>
<form id="time-converter" class="hidden">
@ -158,5 +159,6 @@
</div>
<button type="submit">Convert Times</button>
</form>
</div>
</body>
</html>

@ -23,26 +23,6 @@ function commonPageSetup() {
"Your browser doesn't support MediaSource extensions. Video playback and editing won't work."
);
}
const helpLink = document.getElementById("editor-help-link");
helpLink.addEventListener("click", toggleHelpDisplay);
const closeHelp = document.getElementById("editor-help-box-close");
closeHelp.addEventListener("click", (_event) => {
const helpBox = document.getElementById("editor-help-box");
helpBox.classList.add("hidden");
});
}
function toggleHelpDisplay() {
const helpBox = document.getElementById("editor-help-box");
if (helpBox.classList.contains("hidden")) {
const helpLink = document.getElementById("editor-help-link");
helpBox.style.top = `${helpLink.offsetTop + helpLink.offsetHeight}px`;
helpBox.classList.remove("hidden");
} else {
helpBox.classList.add("hidden");
}
}
function addError(errorText) {

@ -64,6 +64,18 @@ a,
float: right;
}
#page-container {
position: relative;
}
#editor-help {
position: absolute;
top: 0;
right: 0;
background: #222;
padding: 5px;
}
#stream-time-settings {
display: flex;
align-items: flex-end;
@ -212,26 +224,6 @@ a,
top: 0;
}
#editor-help-link {
float: right;
}
#editor-help-box {
position: absolute;
right: 0;
border: 1px solid #000;
padding: 2px;
background: #222;
}
#editor-help-box h2 {
margin: 3px 0;
}
#editor-help-box-close {
float: right;
}
#range-definitions {
display: flex;
flex-direction: column;

Loading…
Cancel
Save