1
0

In main.js ' was replaced with ".

This commit is contained in:
Alexander Andreev 2024-12-30 20:40:26 +04:00
parent 883835bf24
commit 1d956a8430
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -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) => {