From bd8f832683ba9402a365bbc436e13b31f88781b9 Mon Sep 17 00:00:00 2001 From: AppleTheGolden Date: Sun, 12 Oct 2025 00:40:45 +0200 Subject: [PATCH] convert arrow functions to anonymous functions --- copyparty/web/baguettebox.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index 06b2d07f..eb46a917 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -197,11 +197,11 @@ window.baguetteBox = (function () { return true; e.preventDefault ? e.preventDefault() : e.returnValue = false; - fillCbzGallery(gallery, cbzElement, eventHandler).then(() => { - prepareOverlay(gallery, userOptions); - showOverlay(0); + fillCbzGallery(gallery, cbzElement, eventHandler).then(function () { + prepareOverlay(gallery, userOptions); + showOverlay(0); } - ).catch((reason) => { + ).catch(function (reason) { console.error("cbz-ded", reason); var t; try { @@ -227,24 +227,25 @@ window.baguetteBox = (function () { var href = cbzElement.href; var zlsHref = href + (href.indexOf("?") === -1 ? "?" : "&") + "zls"; return fetch(zlsHref) - .then(response => { + .then(function (response) { if (response.ok) { return response.json(); } else { throw new Error("Archive is invalid"); } }) - .then((fileList) => { - var imagesList = fileList.filter((name) => - name.indexOf(".") !== -1 - && cbz_pics.indexOf(name.split(".").pop()) !== -1 + .then(function (fileList) { + var imagesList = fileList.filter(function (name) { + return name.indexOf(".") !== -1 + && cbz_pics.indexOf(name.split(".").pop()) !== -1; + } ).sort(); if (imagesList.length === 0) { throw new Error("Archive does not contain any images"); } - imagesList.forEach((imageName, index) => { + imagesList.forEach(function (imageName, index) { var imageHref = href + (href.indexOf("?") === -1 ? "?" : "&") + "zget=" @@ -256,7 +257,7 @@ window.baguetteBox = (function () { eventHandler: eventHandler, }; gallery.push(galleryItem); - }); + }); }); }