tools / commit
removing export all functionality
separator-page/index.html | 57 ++++++----------------------------------------- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git a/separator-page/index.html b/separator-page/index.html index d938d37..004f231 100644 --- a/separator-page/index.html +++ b/separator-page/index.html @@ -220,9 +220,6 @@ technically *some* scripts can get your local separator page info <div style="display: flex; gap: 8px;"> <button id="reset-icons" style="padding: 4px 8px; font-size: 0.8em; background: #ddd; border: none; border-radius: 4px; cursor: pointer;">Reset</button> - <button id="export-icons" - style="padding: 4px 8px; font-size: 0.8em; background: #ddd; border: none; border-radius: 4px; cursor: pointer;">Export - PNG</button> </div> </div> <div class="previous-icons" id="previous-icons"> @@ -287,9 +284,6 @@ technically *some* scripts can get your local separator page info /** @type {HTMLDivElement} */ const previousIconsContainer = document.getElementById("previous-icons"); - /** @type {HTMLButtonElement} */ - const exportIconsButton = document.getElementById("export-icons"); - /** @type {HTMLButtonElement} */ const resetIconsButton = document.getElementById("reset-icons"); @@ -403,6 +397,12 @@ technically *some* scripts can get your local separator page info } function resetToDefaultIcons() { + const confirmMessage = "Are you sure you want to reset to default icons?\n\nThis will permanently delete ALL your previous icons and replace them with the original template icons.\n\nThis action cannot be undone."; + + if (!confirm(confirmMessage)) { + return; // User cancelled, do nothing + } + localStorage.setItem(previousIconsKey, JSON.stringify(defaultIcons)); renderPreviousIcons(); @@ -457,7 +457,7 @@ technically *some* scripts can get your local separator page info const previousIcons = JSON.parse(localStorage.getItem(previousIconsKey) || "[]"); previousIconsContainer.innerHTML = ""; - previousIcons.forEach(iconUrl => { + previousIcons.forEach((iconUrl, index) => { const iconElement = document.createElement("div"); iconElement.className = "previous-icon"; iconElement.style.backgroundImage = `url('${iconUrl}')`; @@ -532,46 +532,6 @@ technically *some* scripts can get your local separator page info } } - async function exportIcons() { - const previousIcons = JSON.parse(localStorage.getItem(previousIconsKey) || "[]"); - - if (previousIcons.length === 0) { - alert('No icons to export!'); - return; - } - - // Update button to show progress - const originalText = exportIconsButton.textContent; - exportIconsButton.textContent = "Exporting..."; - exportIconsButton.style.background = "#ffa500"; - exportIconsButton.disabled = true; - - let successCount = 0; - - for (let i = 0; i < previousIcons.length; i++) { - const iconUrl = previousIcons[i]; - const filename = `template-icon-${i + 1}.png`; - - const success = await downloadImageAsFile(iconUrl, filename); - if (success) { - successCount++; - } - - // Small delay between downloads to prevent overwhelming the browser - await new Promise(resolve => setTimeout(resolve, 100)); - } - - // Show completion feedback - exportIconsButton.textContent = `Exported ${successCount}/${previousIcons.length}`; - exportIconsButton.style.background = successCount === previousIcons.length ? "#4CAF50" : "#ff9800"; - - setTimeout(() => { - exportIconsButton.textContent = originalText; - exportIconsButton.style.background = "#ddd"; - exportIconsButton.disabled = false; - }, 3000); - } - function saveTabData() { const data = { id: tabId, @@ -665,9 +625,6 @@ technically *some* scripts can get your local separator page info } }); - // Export icons as PNG files - exportIconsButton.addEventListener("click", exportIcons); - // Reset icons to defaults resetIconsButton.addEventListener("click", resetToDefaultIcons);