Fix formatting

pull/350/head
ElementalAlchemist 1 year ago committed by Mike Lang
parent cbf3269001
commit f5c171f5ca

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />

@ -23,7 +23,7 @@ const PLAYBACK_RATES = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
function commonPageSetup() {
if (!Hls.isSupported()) {
addError(
"Your browser doesn't support MediaSource extensions. Video playback and editing won't work."
"Your browser doesn't support MediaSource extensions. Video playback and editing won't work.",
);
}
@ -69,7 +69,7 @@ async function loadVideoPlayer(playlistURL) {
const endTime = getEndTime();
if (endTime && endTime.diff(startTime).milliseconds < 0) {
addError(
"End time is before the start time. This will prevent video loading and cause other problems."
"End time is before the start time. This will prevent video loading and cause other problems.",
);
}
globalPlayer.loadSource(rangedPlaylistURL);
@ -80,7 +80,7 @@ async function loadVideoPlayer(playlistURL) {
case Hls.ErrorTypes.NETWORK_ERROR:
if (data.reason === "no level found in manifest") {
addError(
"There is no video data between the specified start and end times. Change the times so that there is video content to play."
"There is no video data between the specified start and end times. Change the times so that there is video content to play.",
);
} else {
console.log("A fatal network error occurred; retrying", data);
@ -94,7 +94,7 @@ async function loadVideoPlayer(playlistURL) {
default:
console.log("A fatal error occurred; resetting video player", data);
addError(
"Some sort of video player error occurred. Thrimbletrimmer is resetting the video player."
"Some sort of video player error occurred. Thrimbletrimmer is resetting the video player.",
);
resetVideoPlayer();
}
@ -497,7 +497,7 @@ function downloadFrame() {
const videoElement = document.getElementById("video");
const dateTime = dateTimeFromVideoPlayerTime(videoElement.currentTime);
const url = `/frame/${globalStreamName}/source.png?timestamp=${wubloaderTimeFromDateTime(
dateTime
dateTime,
)}`;
// Avoid : as it causes problems on Windows
const filename = `${dateTime.toFormat("yyyy-LL-dd'T'HH-mm-ss.SSS")}.png`;

@ -27,7 +27,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
if (!videoInfo) {
addError(
"Time updates are ignored before the video metadata has been retrieved from Wubloader."
"Time updates are ignored before the video metadata has been retrieved from Wubloader.",
);
return;
}
@ -125,7 +125,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
}
if (rangeErrorCount > 0) {
addError(
"Some ranges couldn't be updated for the new video time endpoints. Please verify the time range values."
"Some ranges couldn't be updated for the new video time endpoints. Please verify the time range values.",
);
}
@ -209,7 +209,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
}
if (canEditMetadata()) {
for (const addChapterMarker of document.getElementsByClassName(
"add-range-definition-chapter-marker"
"add-range-definition-chapter-marker",
)) {
addChapterMarker.addEventListener("click", addChapterMarkerHandler);
}
@ -291,7 +291,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
if (videoInfo.thumbnail_time) {
document.getElementById("video").addEventListener("loadedmetadata", (_event) => {
document.getElementById("video-info-thumbnail-time").value = videoHumanTimeFromWubloaderTime(
videoInfo.thumbnail_time
videoInfo.thumbnail_time,
);
});
}
@ -342,7 +342,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
document.getElementById("reset-entire-video").addEventListener("click", (_event) => {
const forceResetConfirmationContainer = document.getElementById(
"data-correction-force-reset-confirm"
"data-correction-force-reset-confirm",
);
forceResetConfirmationContainer.classList.remove("hidden");
});
@ -351,7 +351,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
});
document.getElementById("data-correction-force-reset-no").addEventListener("click", (_event) => {
const forceResetConfirmationContainer = document.getElementById(
"data-correction-force-reset-confirm"
"data-correction-force-reset-confirm",
);
forceResetConfirmationContainer.classList.add("hidden");
});
@ -371,7 +371,7 @@ async function loadVideoInfo() {
const dataResponse = await fetch("/thrimshim/" + videoID);
if (!dataResponse.ok) {
addError(
"Failed to load video data. This probably means that the URL is out of date (video ID changed) or that everything is broken (or that the Wubloader host is down)."
"Failed to load video data. This probably means that the URL is out of date (video ID changed) or that everything is broken (or that the Wubloader host is down).",
);
return;
}
@ -500,7 +500,7 @@ async function initializeVideoInfo() {
}
const uploadLocationSelection = document.getElementById(
"advanced-submission-option-upload-location"
"advanced-submission-option-upload-location",
);
for (locationName of videoInfo.upload_locations) {
const option = document.createElement("option");
@ -518,7 +518,7 @@ async function initializeVideoInfo() {
if (videoInfo.uploader_whitelist) {
modifiedAdvancedOptions = true;
const uploaderAllowlistBox = document.getElementById(
"advanced-submission-option-uploader-allow"
"advanced-submission-option-uploader-allow",
);
uploaderAllowlistBox.value = videoInfo.uploader_whitelist.join(",");
}
@ -613,14 +613,14 @@ async function initializeVideoInfo() {
if (startWubloaderTime) {
const startField =
rangeDefinitionsContainer.children[rangeIndex].getElementsByClassName(
"range-definition-start"
"range-definition-start",
)[0];
startField.value = videoHumanTimeFromVideoPlayerTime(startPlayerTime);
}
if (endWubloaderTime) {
const endField =
rangeDefinitionsContainer.children[rangeIndex].getElementsByClassName(
"range-definition-end"
"range-definition-end",
)[0];
endField.value = videoHumanTimeFromVideoPlayerTime(endPlayerTime);
}
@ -637,13 +637,13 @@ async function initializeVideoInfo() {
) {
const chapterMarker = chapterMarkerDefinitionDOM();
const chapterStartField = chapterMarker.getElementsByClassName(
"range-definition-chapter-marker-start"
"range-definition-chapter-marker-start",
)[0];
chapterStartField.value = videoHumanTimeFromVideoPlayerTime(
chapterData[currentChapterIndex].start - rangeStartOffset + startPlayerTime
chapterData[currentChapterIndex].start - rangeStartOffset + startPlayerTime,
);
const chapterDescField = chapterMarker.getElementsByClassName(
"range-definition-chapter-marker-description"
"range-definition-chapter-marker-description",
)[0];
chapterDescField.value = chapterData[currentChapterIndex].description;
chapterContainer.appendChild(chapterMarker);
@ -733,7 +733,7 @@ function updateThumbnailInputState(event) {
}
for (const optionElement of document.getElementsByClassName(
"video-info-thumbnail-mode-options"
"video-info-thumbnail-mode-options",
)) {
optionElement.classList.add("hidden");
}
@ -805,7 +805,7 @@ async function sendVideoData(newState, overrideChanges) {
let videoDescription = document.getElementById("video-info-description").value;
if (videoDescription.indexOf(CHAPTER_MARKER_DELIMITER_PARTIAL) !== -1) {
addError(
"Couldn't submit edits: Description contains manually entered chapter marker delimiter"
"Couldn't submit edits: Description contains manually entered chapter marker delimiter",
);
return;
}
@ -858,13 +858,13 @@ async function sendVideoData(newState, overrideChanges) {
if (chaptersEnabled && rangeStartSubmit && rangeEndSubmit) {
const rangeChapters = [];
for (const chapterContainer of rangeContainer.getElementsByClassName(
"range-definition-chapter-markers"
"range-definition-chapter-markers",
)[0].children) {
const startField = chapterContainer.getElementsByClassName(
"range-definition-chapter-marker-start"
"range-definition-chapter-marker-start",
)[0];
const descField = chapterContainer.getElementsByClassName(
"range-definition-chapter-marker-description"
"range-definition-chapter-marker-description",
)[0];
const startFieldTime = videoPlayerTimeFromVideoHumanTime(startField.value);
@ -950,7 +950,7 @@ async function sendVideoData(newState, overrideChanges) {
let thumbnailImage = null;
if (thumbnailMode === "BARE" || thumbnailMode === "TEMPLATE") {
thumbnailTime = wubloaderTimeFromVideoHumanTime(
document.getElementById("video-info-thumbnail-time").value
document.getElementById("video-info-thumbnail-time").value,
);
if (thumbnailTime === null) {
submissionResponseElem.innerText = "The thumbnail time is invalid";
@ -1004,10 +1004,10 @@ async function sendVideoData(newState, overrideChanges) {
const allowHoles = document.getElementById("advanced-submission-option-allow-holes").checked;
const isPublic = !document.getElementById("advanced-submission-option-unlisted").checked;
const uploadLocation = document.getElementById(
"advanced-submission-option-upload-location"
"advanced-submission-option-upload-location",
).value;
const uploaderAllowlistValue = document.getElementById(
"advanced-submission-option-uploader-allow"
"advanced-submission-option-uploader-allow",
).value;
const uploaderAllowlist = uploaderAllowlistValue ? uploaderAllowlistValue.split(",") : null;
@ -1202,7 +1202,7 @@ function updateDownloadLink() {
timeRanges,
downloadType,
allowHoles,
videoInfo.video_quality
videoInfo.video_quality,
);
document.getElementById("download-link").href = downloadURL;
}
@ -1293,7 +1293,7 @@ async function resetVideoRow() {
if (response.ok) {
responseElem.innerText = "Row has been reset.";
const forceResetConfirmationContainer = document.getElementById(
"data-correction-force-reset-confirm"
"data-correction-force-reset-confirm",
);
forceResetConfirmationContainer.classList.add("hidden");
setTimeout(() => {
@ -1450,7 +1450,7 @@ function getRangeSetClickHandler(startOrEnd) {
}
const setButton = event.currentTarget;
const setField = setButton.parentElement.getElementsByClassName(
`range-definition-${startOrEnd}`
`range-definition-${startOrEnd}`,
)[0];
const videoElement = document.getElementById("video");
@ -1535,7 +1535,7 @@ function chapterMarkerDefinitionDOM() {
setStartTime.addEventListener("click", (event) => {
const chapterContainer = event.currentTarget.parentElement;
const startTimeField = chapterContainer.getElementsByClassName(
"range-definition-chapter-marker-start"
"range-definition-chapter-marker-start",
)[0];
const videoElement = document.getElementById("video");
startTimeField.value = videoHumanTimeFromVideoPlayerTime(videoElement.currentTime);
@ -1552,7 +1552,7 @@ function chapterMarkerDefinitionDOM() {
playFromStartTime.addEventListener("click", (event) => {
const chapterContainer = event.currentTarget.parentElement;
const startTimeField = chapterContainer.getElementsByClassName(
"range-definition-chapter-marker-start"
"range-definition-chapter-marker-start",
)[0];
const newVideoTime = videoPlayerTimeFromVideoHumanTime(startTimeField.value);
if (newVideoTime !== null) {
@ -1638,7 +1638,7 @@ function setCurrentRangeStartToVideoTime() {
}
const rangeStartField = document.querySelector(
`#range-definitions > div:nth-child(${currentRange}) .range-definition-start`
`#range-definitions > div:nth-child(${currentRange}) .range-definition-start`,
);
const videoElement = document.getElementById("video");
rangeStartField.value = videoHumanTimeFromVideoPlayerTime(videoElement.currentTime);
@ -1651,7 +1651,7 @@ function setCurrentRangeEndToVideoTime() {
}
const rangeEndField = document.querySelector(
`#range-definitions > div:nth-child(${currentRange}) .range-definition-end`
`#range-definitions > div:nth-child(${currentRange}) .range-definition-end`,
);
const videoElement = document.getElementById("video");
rangeEndField.value = videoHumanTimeFromVideoPlayerTime(videoElement.currentTime);
@ -1666,7 +1666,7 @@ function enableChapterMarkers(enable) {
function changeEnableChaptersHandler() {
const chaptersEnabled = document.getElementById("enable-chapter-markers").checked;
for (const chapterMarkerContainer of document.getElementsByClassName(
"range-definition-chapter-markers"
"range-definition-chapter-markers",
)) {
if (chaptersEnabled) {
chapterMarkerContainer.classList.remove("hidden");
@ -1675,7 +1675,7 @@ function changeEnableChaptersHandler() {
}
}
for (const addChapterMarkerElem of document.getElementsByClassName(
"add-range-definition-chapter-marker"
"add-range-definition-chapter-marker",
)) {
if (chaptersEnabled) {
addChapterMarkerElem.classList.remove("hidden");

@ -70,7 +70,7 @@ async function loadDefaults() {
const defaultDataResponse = await fetch("/thrimshim/defaults");
if (!defaultDataResponse.ok) {
addError(
"Failed to load Thrimbletrimmer data. This probably means that everything is broken (or, possibly, just that the Wubloader host is down). Please sound the alarm."
"Failed to load Thrimbletrimmer data. This probably means that everything is broken (or, possibly, just that the Wubloader host is down). Please sound the alarm.",
);
return;
}
@ -169,7 +169,7 @@ function updateStoredTimeSettings() {
function convertEnteredTimes() {
let timeConvertFrom = undefined;
const timeConvertFromSelection = document.querySelectorAll(
"#time-converter input[name=time-converter-from]"
"#time-converter input[name=time-converter-from]",
);
for (const convertFromItem of timeConvertFromSelection) {
if (convertFromItem.checked) {
@ -184,7 +184,7 @@ function convertEnteredTimes() {
let timeConvertTo = undefined;
const timeConvertToSelection = document.querySelectorAll(
"#time-converter input[name=time-converter-to]"
"#time-converter input[name=time-converter-to]",
);
for (const convertToItem of timeConvertToSelection) {
if (convertToItem.checked) {
@ -208,7 +208,7 @@ function convertEnteredTimes() {
let time = dateTimeFromTimeString(enteredTime, timeConvertFrom);
if (!time) {
addError(
`Failed to parse the time '${enteredTime}' as a value of the selected "convert from" time format.`
`Failed to parse the time '${enteredTime}' as a value of the selected "convert from" time format.`,
);
continue;
}

Loading…
Cancel
Save