mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging
This commit is contained in:
@ -8504,6 +8504,17 @@ jQuery(async function () {
|
|||||||
let targetAvatarImg = thumbURL.substring(thumbURL.lastIndexOf("=") + 1);
|
let targetAvatarImg = thumbURL.substring(thumbURL.lastIndexOf("=") + 1);
|
||||||
let charname = targetAvatarImg.replace('.png', '');
|
let charname = targetAvatarImg.replace('.png', '');
|
||||||
|
|
||||||
|
// Remove existing zoomed avatars for characters that are not the clicked character when moving UI is not enabled
|
||||||
|
if (!power_user.movingUI) {
|
||||||
|
$('.zoomed_avatar').each(function () {
|
||||||
|
const currentForChar = $(this).attr('forChar');
|
||||||
|
if (currentForChar !== charname && typeof currentForChar !== 'undefined') {
|
||||||
|
console.debug(`Removing zoomed avatar for character: ${currentForChar}`);
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let avatarSrc = isDataURL(thumbURL) ? thumbURL : charsPath + targetAvatarImg;
|
let avatarSrc = isDataURL(thumbURL) ? thumbURL : charsPath + targetAvatarImg;
|
||||||
if ($(`.zoomed_avatar[forChar="${charname}"]`).length) {
|
if ($(`.zoomed_avatar[forChar="${charname}"]`).length) {
|
||||||
console.debug('removing container as it already existed')
|
console.debug('removing container as it already existed')
|
||||||
|
@ -199,7 +199,6 @@ async function translateProviderLibre(text, lang) {
|
|||||||
throw new Error(response.statusText);
|
throw new Error(response.statusText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function translateProviderGoogle(text, lang) {
|
async function translateProviderGoogle(text, lang) {
|
||||||
const response = await fetch('/google_translate', {
|
const response = await fetch('/google_translate', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -447,7 +446,9 @@ jQuery(() => {
|
|||||||
});
|
});
|
||||||
$('#translate_url_button').on('click', async () => {
|
$('#translate_url_button').on('click', async () => {
|
||||||
const optionText = $('#translation_provider option:selected').text();
|
const optionText = $('#translation_provider option:selected').text();
|
||||||
const url = await callPopup(`<h3>${optionText} API URL</h3>`, 'input');
|
const exampleURLs = {};
|
||||||
|
exampleURLs['libre'] = 'http://127.0.0.1:5000/translate';
|
||||||
|
const url = await callPopup(`<h3>${optionText} API URL</h3><i>Example: <tt>` + exampleURLs[extension_settings.translate.provider] + `</tt></i>`, 'input');
|
||||||
|
|
||||||
if (url == false) {
|
if (url == false) {
|
||||||
return;
|
return;
|
||||||
|
@ -28,7 +28,7 @@ const CHARACTER_FILTER_SELECTOR = '#rm_characters_block .rm_tag_filter';
|
|||||||
const GROUP_FILTER_SELECTOR = '#rm_group_chats_block .rm_tag_filter';
|
const GROUP_FILTER_SELECTOR = '#rm_group_chats_block .rm_tag_filter';
|
||||||
|
|
||||||
function getFilterHelper(listSelector) {
|
function getFilterHelper(listSelector) {
|
||||||
return $(listSelector).is(GROUP_FILTER_SELECTOR) ? groupCandidatesFilter : entitiesFilter;
|
return $(listSelector).is(GROUP_FILTER_SELECTOR) ? groupCandidatesFilter : entitiesFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tag_filter_types = {
|
export const tag_filter_types = {
|
||||||
@ -170,7 +170,7 @@ function removeTagFromMap(tagId) {
|
|||||||
|
|
||||||
function findTag(request, resolve, listSelector) {
|
function findTag(request, resolve, listSelector) {
|
||||||
const skipIds = [...($(listSelector).find(".tag").map((_, el) => $(el).attr("id")))];
|
const skipIds = [...($(listSelector).find(".tag").map((_, el) => $(el).attr("id")))];
|
||||||
const haystack = tags.filter(t => !skipIds.includes(t.id)).map(t => t.name).sort();
|
const haystack = tags.filter(t => !skipIds.includes(t.id)).map(t => t.name).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
|
||||||
const needle = request.term.toLowerCase();
|
const needle = request.term.toLowerCase();
|
||||||
const hasExactMatch = haystack.findIndex(x => x.toLowerCase() == needle) !== -1;
|
const hasExactMatch = haystack.findIndex(x => x.toLowerCase() == needle) !== -1;
|
||||||
const result = haystack.filter(x => x.toLowerCase().includes(needle));
|
const result = haystack.filter(x => x.toLowerCase().includes(needle));
|
||||||
|
Reference in New Issue
Block a user