-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.min.js
More file actions
11 lines (11 loc) · 315 KB
/
scripts.min.js
File metadata and controls
11 lines (11 loc) · 315 KB
1
2
3
4
5
6
7
8
9
10
11
"use strict";function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),
removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),
generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");
a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){
if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}function loadVideo(){videoUrl=document.getElementById("userUrl").value;var a=document.getElementById("video");a.setAttribute("src",videoUrl),console.log(videoUrl),checkVideoType()}function checkVideoType(){var a=videoUrl.substr(videoUrl.lastIndexOf(".")+1),b=document.getElementById("video");b.setAttribute("type",a),"mp4"!==a&&"ogg"!==a&&alert("Squawk does not support this file type and it may not behave as expected. Squawk supports .mp4 and .ogg formats please check your url for typos or find a different format of the video")}function enablePlayButton(){videoUrl=document.getElementById("userUrl").value,""===videoUrl?(playButton.setAttribute("disabled",""),alert("A url must be entered")):(playButton.removeAttribute("disabled",""),console.log("The video has been loaded"))}function convertToTimeFormat(a){var b=a,c=Math.floor(b/3600);b-=3600*c;var d=Math.floor(b/60);b-=60*d;var e=b.toFixed(3),f=(10>c?"0":"")+c+":"+(10>d?"0":"")+d+":"+(10>e?"0":"")+e;return f}function deleteCaptionHolder(a){console.log("Deleted: "+a);var b=document.getElementById(a);orderedList.removeChild(b);var c=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(c),removeResetButton()}function saveEditCaption(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(c.hasAttribute("disabled")){if(c.removeAttribute("disabled"),d.innerHTML="Save",console.log(a+" can be edited"),c.parentElement.querySelector(".saveTick")){var e=c.parentElement.getElementsByClassName("saveTick");c.parentElement.removeChild(e[0]),console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")}}else{if(c.setAttribute("disabled",""),d.innerHTML="Edit",console.log(a+" has been saved"),c.parentElement.querySelector(".saveTick"));else{var f=document.createElement("div");f.className="saveTick",f.appendChild(document.createTextNode("✔")),c.parentElement.appendChild(f)}var g=orderedList.childNodes.length;checkIfAllCaptionsAreComplete(g)}}function checkIfAllCaptionsAreComplete(a){for(var b=1;a>=b;b+=1){var c=document.getElementById("caption"+b);if(null===c)a+=1;else{if(!c.querySelector(".saveTick"))break;console.log(b+" is saved")}b===a&&(console.log("All captions are saved!"),generateButton.removeAttribute("disabled"),codeOutput.setAttribute("placeholder","Press generate to preview your code here."))}}function playSnippet(a,b){console.log("Play snippet "+a+" from: "+b),video.currentTime=b,console.log(video.currentTime),video.play()}function addResetButton(){captionSection.querySelector("#resetButton")||(console.log("Reset button added"),resetCaptionsButton=document.createElement("button"),resetCaptionsButton.setAttribute("onclick",'removeAllCaptions("")'),resetCaptionsButton.setAttribute("id","resetButton"),resetCaptionsButton.appendChild(document.createTextNode("Reset all Captions")),captionSection.appendChild(resetCaptionsButton))}function removeResetButton(){if(0===orderedList.childNodes.length){var a=document.getElementById("resetButton");captionSection.removeChild(a)}}function removeAllCaptions(){for(;orderedList.firstChild;)orderedList.removeChild(orderedList.firstChild);console.log("Removed all captions & reset button"),removeResetButton(),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),listId=1}!function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),
video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play");
};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),!function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),
"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);
d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),!function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.");
},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord),function(){var a=null,b=function(b){var c=new Blob([b],{type:"text/vtt"});return null!==a&&window.URL.revokeObjectURL(a),a=window.URL.createObjectURL(c)},c=document.getElementById("create"),d=document.getElementById("code");c.addEventListener("click",function(){var a=document.getElementById("downloadlink");a.href=b(d.value),a.style.display="inline-block"},!1)}(),console.log(" ____ _ _ _ \r\n / ___| __ _ _ _ __ ___ _| | __ / | / |\r\n \\___ \\ / _` | | | |/ _` \\ \\ /\\ / / |/ / | | | |\r\n ___) | (_| | |_| | (_| |\\ V V /| < | |_| |\r\n |____/ \\__, |\\__,_|\\__,_| \\_/\\_/ |_|\\_\\ |_(_)_|\r\n |_| "),console.log("A PROGRAM FOR CREATING SUBTITLE FILES IN .vtt FORMAT");var videoUrl,loadButton=document.getElementById("load"),playButton=document.getElementById("playButton"),recordButton=document.getElementById("record"),video=document.getElementById("video"),buttonDown,buttonUp,listId=1,captionSection=document.getElementById("captionSection"),resetCaptionsButton,orderedList=document.getElementById("timeList"),generateButton=document.getElementById("generate"),createFileButton=document.getElementById("create"),codeOutput=document.getElementById("code"),logTime=function(){var a=video.currentTime.toFixed(3);return a},logDownTime=function(){var a=logTime();buttonDown=a,console.log("Recording Started at: "+buttonDown)},logUpTime=function(){var a=logTime();buttonUp=a,console.log("Recording stopped at: "+buttonUp)},addCaptionHolder=function(a,b){console.log("Time stamp added to caption number: "+listId);var c=document.createElement("li");c.setAttribute("id","caption"+listId);var d=document.createElement("input");d.setAttribute("id","input"+listId),d.setAttribute("tabindex",listId),d.setAttribute("type","text");var e=document.createElement("button");e.setAttribute("onclick",'saveEditCaption("input'+listId+'", "save'+listId+'")');var f=document.createElement("button");f.setAttribute("onclick",'playSnippet("'+listId+'", "'+a+'")');var g=document.createElement("button");g.setAttribute("onclick",'deleteCaptionHolder("caption'+listId+'")');var h=document.createElement("span"),i=document.createElement("span");orderedList.appendChild(c),orderedList.lastChild.appendChild(d),orderedList.lastChild.appendChild(e).innerHTML="Save",orderedList.lastChild.appendChild(f).innerHTML="Play snippet",orderedList.lastChild.appendChild(g).innerHTML="Delete",orderedList.lastChild.appendChild(h),orderedList.lastChild.appendChild(i),e.setAttribute("id","save"+listId),h.setAttribute("id","rec_down"+listId),h.className="rec_down",i.setAttribute("id","rec_up"+listId),
i.className="rec_up",f.className="play",g.className="delete",h.innerHTML=convertToTimeFormat(a),i.innerHTML=convertToTimeFormat(b),listId+=1,console.log("not all captions are saved"),generateButton.setAttribute("disabled",""),createFileButton.setAttribute("disabled",""),codeOutput.setAttribute("placeholder","All captions must be saved before you can generate your file.")},getDataFromCaptions=function(){console.log("generate called"),codeOutput.innerHTML="",codeOutput.appendChild(document.createTextNode("WEBVTT\n"));for(var a=orderedList.childNodes.length,b=1;a>=b;b+=1){console.log("getting data from caption "+b);var c=document.getElementById("input"+b);if(null===c)a+=1;else{c="- "+c.value,console.log(c);var d=document.getElementById("rec_down"+b);d=d.textContent;var e=document.getElementById("rec_up"+b);e=e.textContent,console.log(d+" --> "+e),codeOutput.appendChild(document.createTextNode("\r"+b+"\n")),codeOutput.appendChild(document.createTextNode(d+" --> "+e+"\n")),codeOutput.appendChild(document.createTextNode(c+"\r"))}}},enableRecord=function(){recordButton.removeAttribute("disabled",""),"Play"===playButton.innerHTML&&(playButton.innerHTML="Pause")},disableRecord=function(){recordButton.setAttribute("disabled",""),"Pause"===playButton.innerHTML&&(playButton.innerHTML="Play")},playPause=function(){"Play"===playButton.innerHTML?(video.play(),playButton.innerHTML="Pause"):"Pause"===playButton.innerHTML&&(video.pause(),playButton.innerHTML="Play")};loadButton.onclick=function(){loadVideo(),enablePlayButton()},playButton.onclick=playPause,recordButton.onmousedown=logDownTime,recordButton.onmouseup=function(){logUpTime(),addCaptionHolder(buttonDown,buttonUp),addResetButton()},generateButton.onclick=function(){getDataFromCaptions(),createFileButton.removeAttribute("disabled")},video.addEventListener("play",enableRecord),video.addEventListener("pause",disableRecord),video.addEventListener("ended",disableRecord);