From 1d956a8430729bf3c951f20140be7998a6494143 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 30 Dec 2024 20:40:26 +0400 Subject: [PATCH] In main.js ' was replaced with ". --- web/assets/js/main.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/web/assets/js/main.js b/web/assets/js/main.js index a277791..f227171 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -6,7 +6,7 @@ const overlay = document.getElementById("overlay"); const overlay_content = overlay.children[1]; const overlay_label = overlay.children[2]; -const g_tbody = document.getElementsByTagName('tbody')[0]; +const g_tbody = document.getElementsByTagName("tbody")[0]; let g_first_row = g_tbody.firstChild; let g_last_row = g_tbody.lastChild; const g_back_row = document.getElementsByTagName("tr")[1]; @@ -17,8 +17,8 @@ let g_oc_translate = [0, 0]; let g_current_row = g_back_row; -if (localStorage.getItem('audio_volume') == null) - localStorage['audio_volume'] = 0.5; +if (localStorage.getItem("audio_volume") == null) + localStorage["audio_volume"] = 0.5; function overlayClose() { @@ -80,7 +80,7 @@ function overlaySet(pathname, media_type_element) { if (media_type_element !== "img") { media_element.autoplay = media_element.controls = true; media_element.addEventListener("volumechange", e => { - localStorage['audio_volume'] = e.target.volume; }); + localStorage["audio_volume"] = e.target.volume; }); media_element.volume = localStorage["audio_volume"]; media_element.addEventListener("ended", e => { if (overlay_autoplay.checked) b_next.click(); }); } @@ -143,13 +143,13 @@ Array.from(g_tbody.children) overlay_autoplay = document.getElementsByName("autoplay")[0]; -if (localStorage.getItem('autoplay') == null) - localStorage['autoplay'] = overlay_autoplay.checked = false; +if (localStorage.getItem("autoplay") == null) + localStorage["autoplay"] = overlay_autoplay.checked = false; else - overlay_autoplay.checked = localStorage['autoplay']; + overlay_autoplay.checked = localStorage["autoplay"]; overlay_autoplay.addEventListener("change", e => { - localStorage['autoplay'] = e.target.checked; + localStorage["autoplay"] = e.target.checked; const media_element = overlay_content.firstChild; if (e.target.checked && media_element !== undefined) if (media_element.tagName === "AUDIO" || media_element.tagName === "VIDEO") @@ -220,7 +220,7 @@ document.getElementsByName("filter")[0].addEventListener("input", e => filter(e. //// SORT BY COLUMN -const [thead_name, thead_date, thead_size] = document.getElementsByTagName('thead')[0] +const [thead_name, thead_date, thead_size] = document.getElementsByTagName("thead")[0] .children[0].children; if (localStorage.getItem("sort_reverse") == null) @@ -261,7 +261,7 @@ function sortTable(compareFn, filterFn, filterNegFn, target, other) { } thead_name.classList.toggle("clickable"); -thead_name.addEventListener('click', e => { +thead_name.addEventListener("click", e => { e.preventDefault(); sortTable((a,b) => { const a_name = a.children[0].textContent.toLowerCase(); @@ -274,7 +274,7 @@ thead_name.addEventListener('click', e => { }); thead_date.classList.toggle("clickable"); -thead_date.addEventListener('click', e => { +thead_date.addEventListener("click", e => { e.preventDefault(); sortTable((a,b) => { const a_date = new Date(a.children[1].textContent.slice(0, -4)); @@ -297,7 +297,7 @@ function sizeToBytes(size, unit) { } thead_size.classList.toggle("clickable"); -thead_size.addEventListener('click', e => { +thead_size.addEventListener("click", e => { e.preventDefault(); sortTable( (a,b) => {