implement post metadata import and views. implemented series paging and reader view.
This commit is contained in:
@@ -112,6 +112,7 @@
|
||||
|
||||
updateCount();
|
||||
loadCommonTags();
|
||||
dispatchSelectionChanged();
|
||||
}
|
||||
|
||||
function clearSelection() {
|
||||
@@ -121,6 +122,7 @@
|
||||
});
|
||||
updateCount();
|
||||
updateCommonTagsDisplay();
|
||||
dispatchSelectionChanged();
|
||||
}
|
||||
|
||||
function updateCount() {
|
||||
@@ -129,6 +131,39 @@
|
||||
}
|
||||
}
|
||||
|
||||
function dispatchSelectionChanged() {
|
||||
document.dispatchEvent(new CustomEvent('selectionChanged', {
|
||||
detail: { count: state.selectedIds.size }
|
||||
}));
|
||||
}
|
||||
|
||||
// Enable select mode programmatically, optionally without opening the bulk panel
|
||||
function enableSelectMode(skipPanel = false) {
|
||||
if (state.isSelectMode) return;
|
||||
|
||||
state.isSelectMode = true;
|
||||
document.body.classList.add('select-mode');
|
||||
dom.selectBtn.textContent = 'Cancel';
|
||||
dom.selectBtn.classList.add('active');
|
||||
|
||||
if (!skipPanel) {
|
||||
dom.panel.classList.add('active');
|
||||
updateCommonTagsDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
// Disable select mode
|
||||
function disableSelectMode() {
|
||||
if (!state.isSelectMode) return;
|
||||
|
||||
state.isSelectMode = false;
|
||||
document.body.classList.remove('select-mode');
|
||||
dom.selectBtn.textContent = 'Select';
|
||||
dom.selectBtn.classList.remove('active');
|
||||
dom.panel.classList.remove('active');
|
||||
clearSelection();
|
||||
}
|
||||
|
||||
function updateSelectionUI() {
|
||||
// Re-apply selected class to any newly loaded images that are in selection
|
||||
document.querySelectorAll('.img-clickable').forEach(item => {
|
||||
@@ -416,6 +451,7 @@
|
||||
archive: '🗜️',
|
||||
character: '👤',
|
||||
series: '📺',
|
||||
fandom: '🎭',
|
||||
rating: '⚠️',
|
||||
source: '🌐',
|
||||
post: '📌'
|
||||
@@ -435,4 +471,10 @@
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
|
||||
// Expose global API for other scripts (like series editor)
|
||||
window.selectedImages = state.selectedIds;
|
||||
window.clearSelection = clearSelection;
|
||||
window.enableSelectMode = enableSelectMode;
|
||||
window.disableSelectMode = disableSelectMode;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user