From f6b0fc6170810f8a11684a51f25b8046fd77eeb5 Mon Sep 17 00:00:00 2001 From: Fanurs Teh Date: Mon, 1 Aug 2022 18:14:31 -0400 Subject: [PATCH 1/2] :ambulance: Temporary symbols for collapse/expand all --- media/gallery.css | 7 +++++-- media/gallery.js | 20 ++++++++++++-------- package-lock.json | 4 ++-- src/gallery.ts | 4 ++-- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/media/gallery.css b/media/gallery.css index f2341ad..8b13bdb 100644 --- a/media/gallery.css +++ b/media/gallery.css @@ -129,12 +129,15 @@ html { .codicon { padding: 3px; + width: 20px; + height: 20px; background-color: hsl(0, 0%, 17%); - border: 0; + border-color: white; + border-width: 1px; color: white; } .codicon:hover { background-color: hsl(180, 0%, 21%); - border-radius: 5px; + border-radius: 3px; } \ No newline at end of file diff --git a/media/gallery.js b/media/gallery.js index 906f06c..db77378 100644 --- a/media/gallery.js +++ b/media/gallery.js @@ -47,33 +47,37 @@ let expandAll = Array.from(gridElements).some(el => el.style.display === "none"); if (expandAll) { - let collapseAllButton = document.getElementsByClassName("codicon-collapse-all"); + let collapseAllButton = document.getElementsByClassName("temp-collapse-all"); if (collapseAllButton.length !== 0) { - collapseAllButton[0].setAttribute("class", "codicon codicon-expand-all"); + collapseAllButton[0].setAttribute("class", "codicon temp-expand-all"); + collapseAllButton[0].textContent = "+"; } } else { - let expandAllButton = document.getElementsByClassName("codicon-expand-all"); + let expandAllButton = document.getElementsByClassName("temp-expand-all"); if (expandAllButton.length !== 0) { - expandAllButton[0].setAttribute("class", "codicon codicon-collapse-all"); + expandAllButton[0].setAttribute("class", "codicon temp-collapse-all"); + collapseAllButton[0].textContent = "−"; } } return; } - if (node.classList.contains("codicon-expand-all")) { + if (node.classList.contains("temp-expand-all")) { gridElements.forEach((gridElement) => { gridElement.style.display = "grid"; gridElement.previousElementSibling.firstElementChild.textContent = "⮟"; }); - node.setAttribute("class", "codicon codicon-collapse-all"); + node.setAttribute("class", "codicon temp-collapse-all"); + node.textContent = "−"; return; } - if (node.classList.contains("codicon-collapse-all")) { + if (node.classList.contains("temp-collapse-all")) { gridElements.forEach((gridElement) => { gridElement.style.display = "none"; gridElement.previousElementSibling.firstElementChild.textContent = "⮞"; }); - node.setAttribute("class", "codicon codicon-expand-all"); + node.setAttribute("class", "codicon temp-expand-all"); + node.textContent = "+"; return; } diff --git a/package-lock.json b/package-lock.json index 1a76e6a..e5f4958 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-image-gallery", - "version": "0.2.7", + "version": "0.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-image-gallery", - "version": "0.2.7", + "version": "0.4.0", "dependencies": { "@vscode/codicons": "^0.0.31", "panzoom": "^9.4.2" diff --git a/src/gallery.ts b/src/gallery.ts index f597fd8..bb4e457 100644 --- a/src/gallery.ts +++ b/src/gallery.ts @@ -108,8 +108,8 @@ function getWebviewContent(
${Object.keys(imagesBySubFolders).length > 1 ? - '' : - '' + '' : + '' }
${Object.keys(imagesBySubFolders).length} folders found
From d5c975319a2edbb4746fd861c346f8f0fad53b31 Mon Sep 17 00:00:00 2001 From: Fanurs Teh Date: Mon, 1 Aug 2022 18:28:20 -0400 Subject: [PATCH 2/2] :bookmark: Bump to 0.4.1 --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63e5b23..8d4c737 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.4.1] - 2022-08-01 +### Fixed +- Buttons to expand/collapse all sub-folders were not showing up (temporary fix without using [@vscode/codicons](https://github.com/microsoft/vscode-codicons)) + ## [0.4.0] - 2022-07-30 ### Added - Buttons to expand/collapse all sub-folders in the gallery view diff --git a/package-lock.json b/package-lock.json index e5f4958..420d0e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-image-gallery", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-image-gallery", - "version": "0.4.0", + "version": "0.4.1", "dependencies": { "@vscode/codicons": "^0.0.31", "panzoom": "^9.4.2" diff --git a/package.json b/package.json index 5c4aefd..cc7ce72 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-image-gallery", "displayName": "Image Gallery", "description": "An extension that enhances image browsing experience.", - "version": "0.4.0", + "version": "0.4.1", "publisher": "GeriYoco", "repository": { "type": "git",