From 7bc8b63997f3ef4cc1947ae88f819f32e203855d Mon Sep 17 00:00:00 2001 From: XHXIAIEIN Date: Fri, 7 Jun 2024 11:35:12 +0800 Subject: [PATCH] Fix --- script.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script.js b/script.js index d9a45d7..dcca505 100644 --- a/script.js +++ b/script.js @@ -159,13 +159,13 @@ document.addEventListener('DOMContentLoaded', () => { const totalScreenshots = Math.ceil(photos.length / imagesPerCapture); const format = imageFormat.value; const quality = parseInt(imageQuality.value) / 100; - + captureButton.style.display = 'none'; showProgress(progressContainer, progressText, '正在截图...', true); - + const formattedDate = formatDate(new Date()); linksContainer.innerHTML = ''; - + if (totalScreenshots <= fileThreshold) { await processImages(photos, imagesPerCapture, UI, false, format, quality); showProgress(progressContainer, progressText, '截图完成', false); @@ -184,12 +184,12 @@ document.addEventListener('DOMContentLoaded', () => { } }).then(content => { saveAs(content, `Screenshots_${formattedDate}.zip`); - addDownloadLink(linksContainer, imgData, fileName); showProgress(progressContainer, progressText, '完成', false); }); } } + async function processImages(photos, imagesPerCapture, UI, addToZip, format, quality, zip = null) { const { progressText, linksContainer } = UI; for (let i = 0; i < photos.length; i += imagesPerCapture) { @@ -202,7 +202,7 @@ document.addEventListener('DOMContentLoaded', () => { } updateProgress(progressText, (i + imagesPerCapture) / photos.length, '正在截图...', true); } - } + } async function captureAndSaveImage(photos, fileName, UI, format, quality) { const { columnsInput, rowGapInput, columnGapInput, maxWidthInput, paddingXInput, paddingYInput, bgColorInput, pageBorderRadiusInput } = UI;