diff --git a/classifier/css/layout.css b/classifier/css/layout.css index 9fed191..f9547a8 100644 --- a/classifier/css/layout.css +++ b/classifier/css/layout.css @@ -567,24 +567,6 @@ input.tfile__name:focus { border-color: var(--primary); background: var(--bg); o cursor: wait; } -/* ZIP Extract All Button */ -.zip-extract-all-btn { - margin-left: auto; - padding: 0.15rem 0.4rem; - font-size: 0.7rem; - opacity: 0; - transition: opacity 0.15s; -} - -.folder-item:hover .zip-extract-all-btn { - opacity: 1; -} - -.zip-extract-all-btn:disabled { - opacity: 0.5; - cursor: wait; -} - /* ── By-tracking merged-cell table ──────────────────────────────────────── */ #trackingTree { padding: 0; } /* table reaches the edges; cells carry padding */ .ttable { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.82rem; } diff --git a/classifier/js/tree.js b/classifier/js/tree.js index 4a3b3e7..b2a37e7 100644 --- a/classifier/js/tree.js +++ b/classifier/js/tree.js @@ -340,22 +340,6 @@ }); item.appendChild(extractBtn); } - - // Extract All button for folders with ZIP descendants (but not ZIP roots themselves) - if (!folder.isZipRoot && !folder.isVirtualDir) { - const zipCount = countZipDescendants(folder); - if (zipCount > 0) { - const extractAllBtn = document.createElement('button'); - extractAllBtn.className = 'btn btn-sm zip-extract-all-btn'; - extractAllBtn.textContent = `📤 Extract All (${zipCount})`; - extractAllBtn.title = `Extract all ${zipCount} ZIP file(s) in this folder`; - extractAllBtn.addEventListener('click', async (e) => { - e.stopPropagation(); - await handleExtractAllZips(folder); - }); - item.appendChild(extractAllBtn); - } - } // Click handler for selection item.addEventListener('click', (e) => { @@ -507,77 +491,6 @@ } } - /** - * Count ZIP descendants in a folder - */ - function countZipDescendants(folder) { - let count = 0; - if (folder.children) { - for (const child of folder.children) { - if (child.isZipRoot) { - count++; - } - count += countZipDescendants(child); - } - } - return count; - } - - /** - * Get all ZIP folders as flat list - */ - function getZipDescendants(folder, zips = []) { - if (folder.children) { - for (const child of folder.children) { - if (child.isZipRoot) { - zips.push(child); - } - getZipDescendants(child, zips); - } - } - return zips; - } - - /** - * Handle extracting all ZIPs in a folder - */ - async function handleExtractAllZips(folder) { - const zips = getZipDescendants(folder); - if (zips.length === 0) return; - - const confirmed = confirm(`Extract ${zips.length} ZIP file(s)?\n\nThis will create folders for each ZIP with their contents.`); - if (!confirmed) return; - - try { - // Show extracting state on button - const btn = document.querySelector(`.folder-item[data-path="${folder.path}"] .zip-extract-all-btn`); - if (btn) { - btn.textContent = '⏳ Extracting...'; - btn.disabled = true; - } - - // Extract all ZIPs - for (const zip of zips) { - if (zip.zipPath) { - await window.app.modules.scanner.extractZip(zip.zipPath); - } - } - - // Auto-refresh preserving tree state - await window.app.modules.scanner.scanDirectory(window.app.rootHandle, true); - } catch (err) { - console.error('Error extracting ZIPs:', err); - alert('Error extracting ZIPs: ' + err.message); - - // Reset button - const btn = document.querySelector(`.folder-item[data-path="${folder.path}"] .zip-extract-all-btn`); - if (btn) { - btn.textContent = `📤 Extract All (${zips.length})`; - btn.disabled = false; - } - } - } - /** * Toggle folder expansion */