mirror of
https://github.com/greflm13/StaticGalleryBuilder.git
synced 2026-02-05 02:59:27 +00:00
hotfix
This commit is contained in:
@@ -174,7 +174,6 @@
|
|||||||
let shown = [];
|
let shown = [];
|
||||||
let subfolders = [];
|
let subfolders = [];
|
||||||
let controllers = {};
|
let controllers = {};
|
||||||
let currentFolder = "";
|
|
||||||
|
|
||||||
function requestMetadata() {
|
function requestMetadata() {
|
||||||
fetch(".metadata.json").then(response => {
|
fetch(".metadata.json").then(response => {
|
||||||
@@ -196,12 +195,6 @@
|
|||||||
var pid = window.location.href.match(re)[1];
|
var pid = window.location.href.match(re)[1];
|
||||||
openSwipe(parseInt(pid));
|
openSwipe(parseInt(pid));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (items == []) {
|
|
||||||
document.getElementById("imagelist").style.display = "none"
|
|
||||||
} else {
|
|
||||||
document.getElementById("imagelist").style.display = ""
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(error => console.error('Failed to fetch data:', error));
|
.catch(error => console.error('Failed to fetch data:', error));
|
||||||
}
|
}
|
||||||
@@ -225,7 +218,6 @@
|
|||||||
folders.style.display = "none";
|
folders.style.display = "none";
|
||||||
}
|
}
|
||||||
for (const folder of sub) {
|
for (const folder of sub) {
|
||||||
currentFolder = folder.name;
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(folder.metadata);
|
const response = await fetch(folder.metadata);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
@@ -300,6 +292,7 @@
|
|||||||
shown = [];
|
shown = [];
|
||||||
|
|
||||||
window.location.href = window.location.href.split("#")[0] + "#";
|
window.location.href = window.location.href.split("#")[0] + "#";
|
||||||
|
const path = window.location.href.split("#")[0].replace("index.html", "");
|
||||||
|
|
||||||
const selected_tags = [];
|
const selected_tags = [];
|
||||||
const tagcheckboxes = document.querySelectorAll("#tagdropdown input[class='tag']:checked");
|
const tagcheckboxes = document.querySelectorAll("#tagdropdown input[class='tag']:checked");
|
||||||
@@ -318,7 +311,12 @@
|
|||||||
const include = selected_tags.every(tag => tags.some(t => t.startsWith(tag)));
|
const include = selected_tags.every(tag => tags.some(t => t.startsWith(tag)));
|
||||||
|
|
||||||
if (include || selected_tags.length === 0) {
|
if (include || selected_tags.length === 0) {
|
||||||
if (isRecursiveChecked || item.folder === currentFolder) {
|
if (!isRecursiveChecked) {
|
||||||
|
if (item.src.replace(item.name, "") == path) {
|
||||||
|
shown.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
shown.push(item);
|
shown.push(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,15 +326,19 @@
|
|||||||
window.location.href += urltags;
|
window.location.href += urltags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setFilter(selected) {
|
function setFilter(selected) {
|
||||||
tagdropdown = document.getElementById("tagdropdown").getElementsByTagName("li");
|
const tagcheckboxes = document.querySelectorAll("#tagdropdown input[class='tag']");
|
||||||
selected.forEach((tag) => {
|
selected.forEach((tag) => {
|
||||||
for (var i = 0; i < tagdropdown.length; i++) {
|
tagcheckboxes.forEach((checkbox) => {
|
||||||
|
if (checkbox.parentElement.id.trim().substring(1).replace(" ", "%20") == tag) {
|
||||||
|
checkbox.checked = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
{# for (var i = 0; i < tagdropdown.length; i++) {
|
||||||
if (tagdropdown[i].innerText == tag) {
|
if (tagdropdown[i].innerText == tag) {
|
||||||
tagdropdown[i].firstChild.firstChild.checked = true;
|
tagdropdown[i].firstChild.firstChild.checked = true;
|
||||||
}
|
}
|
||||||
}
|
} #}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user