mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Display total and dynamic character count
This commit is contained in:
@@ -942,6 +942,7 @@ async function getCharacters() {
|
||||
}
|
||||
await getGroups();
|
||||
await printCharacters();
|
||||
updateCharacterCount('#rm_print_characters_block > div');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6458,6 +6459,15 @@ const swipe_right = () => {
|
||||
}
|
||||
}
|
||||
|
||||
export function updateCharacterCount(characterSelector) {
|
||||
const visibleCharacters = $(characterSelector).not('.hiddenBySearch').not('.hiddenByTag').not('.hiddenByGroup').not('.hiddenByGroupMember').not('.hiddenByFav');
|
||||
const visibleCharacterCount = visibleCharacters.length;
|
||||
const totalCharacterCount = $(characterSelector).length;
|
||||
|
||||
$('#rm_character_count').text(`(${visibleCharacters.length} / ${totalCharacterCount}) Characters`);
|
||||
console.log('visibleCharacters.length: ' + visibleCharacters.length);
|
||||
}
|
||||
|
||||
function updateVisibleDivs(containerSelector, resizecontainer) {
|
||||
var $container = $(containerSelector);
|
||||
var $children = $container.children();
|
||||
@@ -6712,6 +6722,8 @@ $(document).ready(function () {
|
||||
});
|
||||
updateVisibleDivs('#rm_print_characters_block', true);
|
||||
}
|
||||
updateCharacterCount(selector);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user