Skip to content

Commit 50e42cd

Browse files
committed
New: Add support for labels in master folders (auto config only)
1 parent 47c491b commit 50e42cd

5 files changed

Lines changed: 8 additions & 11 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2121
- Progressive thumbnail/progress generation based on scroll position [`1d22f22`](https://github.com/ollm/OpenComic/commit/1d22f2290e81785f3c785af9d2eef132cea2935f)
2222
- Option to mark as read and unread [`82ae5ef`](https://github.com/ollm/OpenComic/commit/82ae5ef7e24afc47a6e817b6df5ef6d81099eeb5)
2323
- Option to show page number in the top right-hand corner [`35e44c6`](https://github.com/ollm/OpenComic/commit/35e44c6e271e545a09de4f66ecd0bd289e217447)
24+
- Add support for labels in master folders (auto config only)
2425

2526
##### 🐛 Bug Fixes
2627

@@ -33,7 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3334
- Navigation back not working with shortcuts and gamepad [`ba8641f`](https://github.com/ollm/OpenComic/commit/ba8641f96ed3c8bdef8e35ce98af55b7e6d10bc8)
3435
- Correct invert some shortcuts in manga reading [`208fee6`](https://github.com/ollm/OpenComic/commit/208fee6d48c1dab69b131e45f997326323ac8625)
3536
- Optimized poster handling in file image retrieval [`53b5c42`](https://github.com/ollm/OpenComic/commit/53b5c42ee98ade28ad72c492bd9f6e67b119cd50)
36-
- Do not use the ignore pattern when searching for poster/images
37+
- Do not use the ignore pattern when searching for poster/images [`7b52b28`](https://github.com/ollm/OpenComic/commit/7b52b28952cf2b6140541087c88e6278de32824c)
3738

3839
## [v1.5.0](https://github.com/ollm/OpenComic/releases/tag/v1.5.0) (19-06-2025)
3940

‎scripts/dom.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,13 +2412,10 @@ async function comicContextMenu(path, mainPath, fromIndex = true, fromIndexNotMa
24122412

24132413
if(fromIndex || folder)
24142414
{
2415-
let comicLabels = storage.get('comicLabels');
2416-
let hasLabels = comicLabels[path] ? true : false;
2417-
24182415
labels.style.display = 'block';
24192416
labels.setAttribute('onclick', 'dom.labels.setLabels(\''+escapeQuotes(escapeBackSlash(path), 'simples')+'\');');
24202417

2421-
if(hasLabels)
2418+
if(dom.labels.has(path))
24222419
labels.querySelector('i').classList.add('fill');
24232420
else
24242421
labels.querySelector('i').classList.remove('fill');

‎scripts/reading.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3825,10 +3825,9 @@ function updateConfigLabels()
38253825
list.innerHTML = template.load('reading.content.right.labels.list.html');
38263826
}
38273827

3828-
function getLabelConfigKey(path = false)
3828+
function getLabelConfigKey()
38293829
{
3830-
path = path || dom.history.mainPath;
3831-
const labels = dom.labels.has(path);
3830+
const labels = dom.labels.has(dom.history.path, true);
38323831

38333832
if(labels.length)
38343833
{
@@ -3864,7 +3863,7 @@ function purgeGlobalReadingPagesConfig()
38643863

38653864
if(configKey === 0)
38663865
{
3867-
const labelConfigKey = getLabelConfigKey(path);
3866+
const labelConfigKey = getLabelConfigKey();
38683867

38693868
if(labelConfigKey === 0)
38703869
storage.deleteVar('readingPagesConfig', path);

‎scripts/settings.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function removeMasterFolder(key)
256256
function updateMasterFolders()
257257
{
258258
let masterFolders = storage.get('masterFolders');
259-
handlebarsContext.masterFolders = masterFolders;
259+
handlebarsContext.masterFolders = masterFolders.map(path => ({path, hasLabels: dom.labels.has(path)}));
260260

261261
let contentRight = template._contentRight();
262262

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{{#each masterFolders}}
2-
<div class="chip chip-icon-right label-large" onclick="electron.shell.openPath('{{chain 'escapeBackSlash' 'escapeQuotesSimples' @this}}');"><div></div>{{@this}}<i class="icon-18 material-icon right gamepad-item" onclick="event.stopPropagation(); settings.removeMasterFolder({{@key}});">close</i></div>
2+
<div class="chip chip-icon-right label-large" onclick="electron.shell.openPath('{{chain 'escapeBackSlash' 'escapeQuotesSimples' path}}');"><div></div>{{path}}<i class="icon-18 material-icon right gamepad-item" onclick="event.stopPropagation(); settings.removeMasterFolder({{@key}});">close</i><i class="icon-18 material-icon right gamepad-item{{#if hasLabels}} fill{{/if}}" onclick="event.stopPropagation(); dom.labels.setLabels('{{chain 'escapeBackSlash' 'escapeQuotesSimples' path}}');" style="margin-right: 0px;">label</i></div>
33
{{/each}}

0 commit comments

Comments
 (0)