Skip to content

Commit

Permalink
Add a minor code comment + rename some vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
Badatos committed Oct 16, 2023
1 parent 0d87cac commit a3efdca
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pod/completion/static/js/caption_maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/

// Global vars
var file_loaded = false;
var file_loaded_id = undefined;
var fileLoaded = false;
var fileLoadedId = undefined;
var captionsArray = [];
var autoPauseAtTime = -1;

const caption_memories = {
const captionMemories = {
start_time: "00:00.000",
};
const file_prefix = window.location.pathname
Expand Down Expand Up @@ -92,7 +92,7 @@ document.addEventListener("submit", (e) => {
showalert(gettext("There is no caption/subtitle to save."), "alert-danger");
return;
}
if (typeof file_loaded != "undefined" && file_loaded) {
if (typeof fileLoaded != "undefined" && fileLoaded) {
let saveModalId = document.getElementById("saveCaptionsModal");
let saveModal = bootstrap.Modal.getOrCreateInstance(saveModalId);
saveModal.show();
Expand All @@ -116,7 +116,7 @@ document.addEventListener("click", (evt) => {
if (evt.target.id == "modal-btn-override") {
document
.getElementById("form_save_captions")
.querySelector('input[name="file_id"]').value = file_loaded_id;
.querySelector('input[name="file_id"]').value = fileLoadedId;
//form_save_captions.querySelector('input[name="enrich_ready"]').value = "";
updateCaptionsArray(caption_content.value);
send_form_save_captions();
Expand Down Expand Up @@ -515,8 +515,8 @@ function generateWEBVTT() {
let captionBlocks = document
.querySelectorAll("#newCaptionsEditor > .newEditorBlock");


if (!validateForms(captionBlocks)){
// If form has invalid fields, do not continue.
if (!validateForms(captionBlocks)) {
return false;
}
captionBlocks.forEach((e) => {
Expand Down Expand Up @@ -1063,7 +1063,7 @@ editorShortcuts.init();
function addCaptionListRow(ci, newCaption) {
let vtt = document.getElementById("captionContent");
let vtt_entry = document.getElementById("textCaptionEntry").value.trim();
let start = caption_memories.start_time;
let start = captionMemories.start_time;

const pod = document.getElementById("podvideoplayer");
const podPlayer = pod.player;
Expand All @@ -1079,7 +1079,7 @@ function addCaptionListRow(ci, newCaption) {
}

createCaptionBlock(newCaption);
caption_memories.start_time = end;
captionMemories.start_time = end;
}

/**
Expand Down Expand Up @@ -1270,8 +1270,8 @@ function processProxyVttResponse(obj) {
else if (obj.status == "success") {
// delete any captions we've got
captionsArray.length = 0;
file_loaded = true;
file_loaded_id = obj.id_file;
fileLoaded = true;
fileLoadedId = obj.id_file;
current_folder = obj.id_folder;
document.querySelectorAll(".newEditorBlock").forEach((elt) => {
elt.remove();
Expand Down

0 comments on commit a3efdca

Please sign in to comment.