Univerter/static/js/main.js

26 lines
911 B
JavaScript
Raw Normal View History

2024-07-31 02:54:26 -05:00
var audioFormats = ["mp3"]
function updateOptions() {
var format = $("#format").val()
if (audioFormats.includes(format)) {
$("#audioOnly > input").attr("disabled", false)
$("#videoAndAudio > input").attr("disabled", true)
} else {
$("#audioOnly > input").attr("disabled", true)
$("#videoAndAudio > input").attr("disabled", false)
}
}
$(document).ready(() => {
2024-07-31 02:54:26 -05:00
updateOptions()
$("#format").on("change", updateOptions)
$("#quality").val(Cookies.get("quality") || "720")
2024-07-31 02:54:26 -05:00
$("#trim").prop("checked", Cookies.get("trim") == "true" || false)
$("#playInBrowser").prop("checked", Cookies.get("playInBrowser") == "true" || false)
$("form").submit(() => {
Cookies.set("quality", $("#quality").val())
2024-07-31 02:54:26 -05:00
Cookies.set("trim", $("#trim").prop("checked"))
Cookies.set("playInBrowser", $("#playInBrowser").prop("checked"))
})
})