Move filter by favorites to an actionable tag

This commit is contained in:
SillyLossy
2023-05-08 13:47:51 +03:00
parent d3d8f2ced6
commit 5203c2a8b6
5 changed files with 46 additions and 53 deletions

View File

@@ -238,7 +238,6 @@ let chat_metadata = {};
let streamingProcessor = null;
let fav_ch_checked = false;
window.filterByFav = false;
const durationSaveEdit = 200;
const saveSettingsDebounced = debounce(() => saveSettings(), durationSaveEdit);
@@ -1367,24 +1366,6 @@ function isStreamingEnabled() {
|| (main_api == 'textgenerationwebui' && textgenerationwebui_settings.streaming);
}
function applyFavFilter(enabled) {
const selector = ['#rm_print_characters_block .character_select', '#rm_print_characters_block .group_select'].join(',');
if (enabled) {
$(selector).each(function () {
if ($(this).find(".ch_fav").length !== 0) {
const shouldBeDisplayed = $(this).find(".ch_fav").val().toLowerCase().includes(true);
$(this).toggleClass('hiddenByFav', !shouldBeDisplayed);
}
});
}
else {
$(selector).removeClass('hiddenByFav');
}
}
class StreamingProcessor {
showStopButton(messageId) {
if (messageId == -1) {
@@ -3642,7 +3623,6 @@ function select_rm_characters() {
menu_type = "characters";
selectRightMenuWithAnimation('rm_characters_block');
setRightTabSelectedClass('rm_button_characters');
applyFavFilter(window.filterByFav);
}
function restoreSelectedCharacter() {
@@ -4256,17 +4236,6 @@ $(document).ready(function () {
}
});
$("#filter_by_fav").click(function () {
filterByFav = !filterByFav;
if (filterByFav) {
applyFavFilter(true);
$("#filter_by_fav").addClass("fav_on");
} else {
applyFavFilter(false);
$("#filter_by_fav").removeClass("fav_on");
}
});
$("#send_but").click(function () {
if (is_send_press == false) {
is_send_press = true;