Update tl

9d664bc679b5ff61a9490ee29421beabbf1d15dd

Yokayo <nonameutubecomm@gmail.com>

14 files changed, +181 -94Showing whitespace changes
public/css/promptmanager.css+1 -1
@@ -333,7 +333,7 @@
333333}
334334
335335.completion_prompt_manager_popup_entry_form_control:has(#completion_prompt_manager_popup_entry_form_prompt:disabled)>div:first-child::after {
336- content: 'The content of this prompt is pulled from elsewhere and cannot be edited here.';
336+ content: attr(external_piece_text);
337337 display: block;
338338 width: 100%;
339339 font-weight: 600;
public/index.html+2 -2
@@ -2782,7 +2782,7 @@
27822782 </div>
27832783 </form>
27842784 <form id="claude_form" data-source="claude" action="javascript:void(null);" method="post" enctype="multipart/form-data">
27852785 <h4 data-i18n="Claude API Key">Claude API Key</h4>
27862786 <div>
27872787 <span data-i18n="Get your key from">Get your key from </span> <a target="_blank" href="https://console.anthropic.com/account/keys" data-i18n="Anthropic's developer console">Anthropic's developer console</a>.
27882788 </div>
@@ -5999,7 +5999,7 @@
59995999 </div>
60006000 </div>
60016001 <div class="completion_prompt_manager_popup_entry_form_control">
6002- <div class="flex-container alignItemsCenter">
6002+ <div class="flex-container alignItemsCenter" data-i18n="[external_piece_text]The content of this prompt is pulled from elsewhere and cannot be edited here." external_piece_text="The content of this prompt is pulled from elsewhere and cannot be edited here.">
60036003 <div class="flex1">
60046004 <label for="completion_prompt_manager_popup_entry_form_prompt">
60056005 <span data-i18n="Prompt">Prompt</span>
public/locales/ru-ru.json+91 -7
@@ -177,7 +177,7 @@
177177 "(Saved to Context Template)": "(Сохраняется в шаблоне контекста)",
178178 "Tokenizer": "Токенайзер",
179179 "Token Padding": "Кол-во добавочных токенов",
180180 "Save preset as": "Сохранить пресет как...",
181181 "Always add character's name to prompt": "Всегда добавлять имя персонажа в промпт",
182182 "Use as Stop Strings": "Использовать в качестве стоп-строк",
183183 "Bind to Context": "Привязка к контексту",
@@ -275,12 +275,12 @@
275275 "Chatty": "Разговорчивый",
276276 "Examples of dialogue": "Примеры диалога",
277277 "Save": "Сохранить",
278278 "Chat History": "История чатачатов",
279279 "Content": "Содержание",
280280 "Selective": "Выборочно",
281281 "Disable": "Отключено",
282282 "Back to parent chat": "Вернуться в основной чат",
283283 "Convert to group": "Превратить вСделать группугрупповым",
284284 "Start new chat": "Начать новый чат",
285285 "Delete messages": "Удалить сообщения",
286286 "Impersonate": "Перевоплощение",
@@ -434,7 +434,7 @@
434434 "Persona Description": "Описание персоны",
435435 "Your Persona": "Ваша персона",
436436 "Show notifications on switching personas": "Показывать уведомления при смене персоны",
437437 "In Story String / Prompt Manager": "В строке истории / МенеджерМенеджере промптов",
438438 "Top of Author's Note": "Сверху от заметок автора",
439439 "Bottom of Author's Note": "Снизу от заметок автора",
440440 "How do I use this?": "Как пользоваться?",
@@ -1160,7 +1160,8 @@
11601160 "ext_regex_global_scripts_desc": "Распространяются на всех персонажей. Сохраняются как часть настроек.",
11611161 "ext_regex_scoped_scripts": "Локальные скрипты",
11621162 "ext_regex_scoped_scripts_desc": "Распространяются только на этого персонажа. Сохраняются в его карточку.",
11631163 "ext_regex_allow_scoped": "Разрешить использованиеВключить локальныхлокальные скриптовскрипты",
1164+ "ext_regex_disallow_scoped": "Отключить локальные скрипты",
11641165 "ext_regex_move_to_global": "Сделать глобальным",
11651166 "openai_logit_bias_no_items": "Правил нет",
11661167 "Enable function calling": "Включить функции",
@@ -1903,7 +1904,7 @@
19031904 "No sections selected for export": "Не выбрано ни одной секции для экспорта",
19041905 "Cannot update GUI preset": "Пресет для GUI обновить невозможно",
19051906 "Template updated": "Шаблон сохранён",
19061907 "Hint: Use a character/group name to bind preset to a specific chat.": "Совет: введите имя персонажа/группы, чтобы привязать пресет к определённомуопределённым чатучатам.",
19071908 "Preset name:": "Название пресета:",
19081909 "Template name:": "Название шаблона:",
19091910 "Preset saved": "Пресет сохранён",
@@ -1951,5 +1952,88 @@
19511952 "from other websites": "с других сайтов.",
19521953 "Go to the": "Загляните в",
19531954 "to install additional features.": ", чтобы установить разные дополнительные ресурсы.",
19541955 "or_welcome": "; также доступен",
1956+ "Claude API Key": "Ключ от API Claude",
1957+ "Block Entropy API Key": "Ключ от API Block Entropy",
1958+ "Select a Model": "Выберите модель",
1959+ "The content of this prompt is pulled from elsewhere and cannot be edited here.": "Эта часть промпта подтягивается откуда-то извне. Отредактировать её здесь невозможно.",
1960+ "save": "сохранить",
1961+ "reset": "сбросить",
1962+ "close": "закрыть",
1963+ "Your preset contains proxy and/or custom endpoint settings.": "Ваш пресет содержит настройки прокси и/или настройки кастомного эндпоинта.",
1964+ "Do you want to remove these fields before exporting?": "Желаете ли удалить эти поля перед экспортом?",
1965+ "Save": "Сохранить",
1966+ "Chat Lorebook": "Лорбук для чата",
1967+ "chat_world_template_txt": "Выбранный мир будет привязан к этому чату. Будет добавляться в промпт наряду с глобальным лорбуком и лором персонажа.",
1968+ "world_button_title": "Лор персонажа\n\nНажмите, чтобы загрузить\nShift + клик, чтобы открыть диалог привязки мира",
1969+ "No auxillary Lorebooks set. Click here to select.": "Вспомогательный лорбук не выбран. Нажмите, чтобы выбрать.",
1970+ "ext_regex_user_input_desc": "Отправленные вами сообщения.",
1971+ "ext_regex_ai_input_desc": "Полученные от API ответы.",
1972+ "ext_regex_slash_desc": "Сообщения, отправленные с помощью команд STscript.",
1973+ "ext_regex_wi_desc": "Содержимое лорбуков/информации о мире. Работает только со включенной галочкой \"Только промпт\"!",
1974+ "ext_regex_run_on_edit_desc": "Выполнять скрипт при редактировании принадлежащего обозначенной роли (ролям) сообщений.",
1975+ "Convert to group chat": "Сделать чат групповым",
1976+ "Are you sure you want to convert this chat to a group chat?": "Вы точно хотите сделать этот чат групповым?",
1977+ "This cannot be reverted.": "Отменить будет невозможно.",
1978+ "Enter a name for this persona:": "Введите имя для этой персоны:",
1979+ "Cancel if you're just uploading an avatar.": "Отмените, если просто загружаете аватарку.",
1980+ "Set the crop position of the avatar image": "Обозначьте зону, по которой будет обрезана аватарка",
1981+ "popup-button-crop": "Обрезать",
1982+ "Duplicate persona": "Клонировать персону",
1983+ "Are you sure you want to duplicate this persona?": "Вы точно хотите клонировать эту персону?",
1984+ "Enter a description for this persona:": "Введите описание для этой персоны:",
1985+ "You can always add or change it later.": "Его можно будет добавить или изменить в любое время.",
1986+ "You can now pick ${0} as a persona in the Persona Management menu.": "Теперь ${0} может быть выбран(а) в качестве персоны в меню \"Управление персоной\".",
1987+ "Persona Created": "Персона создана",
1988+ "Overwrite Existing Persona": "Перезаписать существующую персону",
1989+ "This character exists as a persona already. Do you want to overwrite it?": "Этот персонаж уже существует в виде персоны. Желаете перезаписать?",
1990+ "Persona Description Macros": "Макросы в описании персоны",
1991+ "This character has a description that uses <code>{{char}}</code> or <code>{{user}}</code> macros. Do you want to swap them in the persona description?": "В описании персонажа присутствуют макросы <code>{{char}}</code> и/или <code>{{user}}</code>. Желаете поменять их местами?",
1992+ "(If empty name is provided, this will unbind the name from this avatar)": "(если оставить пустым, то имя будет отвязано от этой аватарки)",
1993+ "To permanently set \"${0}\" as the selected persona, unlock and relock it using the \"Lock\" button. Otherwise, the selection resets upon reloading the chat.": "Чтобы перманентно привязать персону \"${0}\" к этому чату, открепите текущую персону и затем закрепите новую кнопкой \"Закрепить\". Иначе при следующем заходе персона будет сброшена.",
1994+ "This chat is locked to a different persona (${0}).": "К этому чату уже привязана другая персона (${0}).",
1995+ "User persona is now unlocked for this chat. Click the \"Lock\" again to revert.": "Персона откреплена. Нажмите \"Закрепить\", чтобы снова зафиксировать её в этом чате.",
1996+ "Persona unlocked": "Персона откреплена",
1997+ "Creating a new persona for currently selected user name and avatar...": "Создаём новую персону для этого имени и аватарки...",
1998+ "Persona not set for this avatar": "К этой аватарке не привязано ни одной персоны",
1999+ "User persona is locked to ${0} in this chat": "${0} установлен(а) в качестве фиксированной персоны в этом чате",
2000+ "You cannot delete the avatar you are currently using": "Невозможно удалить аватарку, которую вы используете прямо сейчас",
2001+ "Warning": "Внимание",
2002+ "Are you sure you want to delete this avatar?": "Вы точно хотите удалить эту аватарку?",
2003+ "All information associated with its linked persona will be lost.": "Вся информация о связанной с ней персоне будет утеряна.",
2004+ "The default persona was deleted. You will need to set a new default persona.": "Удалена персона по умолчанию. Вам будет необходимо выбрать новую вместо неё.",
2005+ "Default persona deleted": "Удалена персона по умолчанию",
2006+ "The locked persona was deleted. You will need to set a new persona for this chat.": "Удалена привязанная к чату персона. Вам будет необходимо выбрать новую фиксированную персону для этого чата.",
2007+ "Persona deleted": "Персона удалена",
2008+ "You must bind a name to this persona before you can set it as the default.": "Прежде чем установить эту персону в качестве персоны по умолчанию, ей необходимо задать имя.",
2009+ "Persona name not set": "У персоны отсутствует имя",
2010+ "Are you sure you want to remove the default persona?": "Вы точно хотите снять статус персоны по умолчанию?",
2011+ "This persona will no longer be used by default when you open a new chat.": "Эта персона больше не будет автоматически выбираться при старте нового чата",
2012+ "Default persona removed": "Персона по умолчанию снята",
2013+ "Are you sure you want to set \"${0}\" as the default persona?": "Вы точно хотите установить \"${0}\" в качестве персоны по умолчанию?",
2014+ "This name and avatar will be used for all new chats, as well as existing chats where the user persona is not locked.": "Это имя и аватарка будут автоматически выбираться при старте нового чата, а также в любом существующем чате, где нет фиксированной персоны.",
2015+ "This persona will be used by default when you open a new chat.": "Эта персона будет выбираться автоматически при старте нового чата.",
2016+ "Default persona set to ${0}": "${0} установлен(а) в качестве персоны по умолчанию",
2017+ "Invalid file selected": "Загружен невалидный файл",
2018+ "Invalid file format": "Некорректный формат файла",
2019+ "Personas restored with warnings. Check console for details.": "Персона восстановлена, но были сгенерированы варнинги. Подробности см. в консоли.",
2020+ "Personas restored successfully.": "Персона успешно восстановлена.",
2021+ "All user-sent messages in this chat will be attributed to ${0}.": "Все ваши сообщения в этом чате будут приписаны ${0}.",
2022+ "Forbid Media Override explanation": "Способность текущего персонажа/группы использовать в чате внешние медиа.",
2023+ "forbid_media_global_state_forbidden": "(запрещены)",
2024+ "forbid_media_global_state_allowed": "(разрешены)",
2025+ "Always forbidden": "Всегда запрещены",
2026+ "Always allowed": "Всегда разрешены",
2027+ "Forbid Media Override subtitle": "Под медиа подразумеваются картинки, видео, аудио. Под внешними - любые, не хостящиеся на локальном сервере.",
2028+ "Tag Management": "Управление тегами",
2029+ "Save your tags to a file": "Сохранить ваши теги в файл",
2030+ "Restore tags from a file": "Восстановить теги из файла",
2031+ "Create a new tag": "Создать новый тег",
2032+ "Drag handle to reorder. Click name to rename. Click color to change display.": "Перемещайте мышкой, чтобы менять порядок. Нажмите, чтобы переименовать. Нажмите на цвет, чтобы сменить его.",
2033+ "Click on the folder icon to use this tag as a folder.": "Нажмите на иконку папки, чтобы использовать тег как папку.",
2034+ "Use alphabetical sorting": "Сортировать по алфавиту",
2035+ "tags_sorting_desc": "Автоматически сортировать теги по алфавиту после создания или переименования одного из них.\nПри выключении новые теги будут просто добавляться в конец.\n\nЕсли вручную перетащить один из тегов на другое место, автосортировка отключится.",
2036+ "Imported tags:": "Импортируемые теги:",
2037+ "Importing Tags": "Импорт тегов",
2038+ "Couldn't import tags:": "Не удалось импортировать теги:"
19552039}
public/script.js+2 -2
@@ -7491,7 +7491,7 @@ export function callPopup(text, type, inputValue = '', { okButton, rows, wide, w
74917491 } else if (['new_chat', 'confirm'].includes(popup_type)) {
74927492 return okButton ?? 'Yes';
74937493 } else if (['input'].includes(popup_type)) {
74947494 return okButton ?? 't`Save'`;
74957495 }
74967496 return okButton ?? 'Delete';
74977497 }
@@ -7861,7 +7861,7 @@ function openCharacterWorldPopup() {
78617861 if (!isMobile()) {
78627862 $(extraSelect).select2({
78637863 width: '100%',
78647864 placeholder: 't`No auxillary Lorebooks set. Click here to select.'`,
78657865 allowClear: true,
78667866 closeOnSelect: false,
78677867 });
public/scripts/bookmarks.js+2 -1
@@ -32,6 +32,7 @@ import { commonEnumProviders } from './slash-commands/SlashCommandCommonEnumsPro
3232import { SlashCommandParser } from './slash-commands/SlashCommandParser.js';
3333import { createTagMapFromList } from './tags.js';
3434import { renderTemplateAsync } from './templates.js';
35+import { t } from './i18n.js';
3536
3637import {
3738 getUniqueName,
@@ -263,7 +264,7 @@ export async function convertSoloToGroupChat() {
263264 return;
264265 }
265266
266267 const confirm = await Popup.show.confirm('t`Convert to group chat'`, 't`Are you sure you want to convert this chat to a group chat?` + `<br />` + t`This cannot be reverted.'`);
267268 if (!confirm) {
268269 return;
269270 }
public/scripts/extensions/regex/dropdown.html+1 -1
@@ -38,7 +38,7 @@
3838 <strong class="flex1" data-i18n="ext_regex_scoped_scripts">Scoped Scripts</strong>
3939 <label id="toggle_scoped_regex" class="checkbox flex-container" for="regex_scoped_toggle">
4040 <input type="checkbox" id="regex_scoped_toggle" class="enable_scoped" />
4141 <span class="regex-toggle-on fa-solid fa-toggle-on fa-lg" data-i18n="[title]ext_regex_disallow_scoped" title="Disallow using scoped regex"></span>
4242 <span class="regex-toggle-off fa-solid fa-toggle-off fa-lg" data-i18n="[title]ext_regex_allow_scoped" title="Allow using scoped regex"></span>
4343 </label>
4444 </div>
public/scripts/extensions/regex/editor.html+5 -5
@@ -70,25 +70,25 @@
7070 <div class="flex-container">
7171 <div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart">
7272 <small data-i18n="ext_regex_affects">Affects</small>
7373 <div data-i18n="[title]ext_regex_user_input_desc" title="Messages sent by the user.">
7474 <label class="checkbox flex-container">
7575 <input type="checkbox" name="replace_position" value="1">
7676 <span data-i18n="ext_regex_user_input">User Input</span>
7777 </label>
7878 </div>
7979 <div data-i18n="[title]ext_regex_ai_input_desc" title="Messages received from the Generation API.">
8080 <label class="checkbox flex-container">
8181 <input type="checkbox" name="replace_position" value="2">
8282 <span data-i18n="ext_regex_ai_output">AI Output</span>
8383 </label>
8484 </div>
8585 <div data-i18n="[title]ext_regex_slash_desc" title="Messages sent using STscript commands.">
8686 <label class="checkbox flex-container">
8787 <input type="checkbox" name="replace_position" value="3">
8888 <span data-i18n="Slash Commands">Slash Commands</span>
8989 </label>
9090 </div>
9191 <div data-i18n="[title]ext_regex_wi_desc" title="Lorebook/World Info entry contents. Requires 'Only Format Prompt' to be checked!">
9292 <label class="checkbox flex-container">
9393 <input type="checkbox" name="replace_position" value="5">
9494 <span data-i18n="World Info">World Info</span>
@@ -117,7 +117,7 @@
117117 <input type="checkbox" name="disabled" />
118118 <span data-i18n="Disabled">Disabled</span>
119119 </label>
120120 <label class="checkbox flex-container" data-i18n="[title]ext_regex_run_on_edit_desc" title="Run the regex script when the message belonging a to specified role(s) is edited.">
121121 <input type="checkbox" name="run_on_edit" />
122122 <span data-i18n="Run On Edit">Run On Edit</span>
123123 </label>
public/scripts/extensions/regex/index.js+2 -1
@@ -9,6 +9,7 @@ import { SlashCommandEnumValue, enumTypes } from '../../slash-commands/SlashComm
99import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
1010import { download, getFileText, getSortableDelay, uuidv4 } from '../../utils.js';
1111import { regex_placement, runRegexScript } from './engine.js';
12+import { t } from '../../i18n.js';
1213
1314/**
1415 * @typedef {object} RegexScript
@@ -275,7 +276,7 @@ async function onRegexEditorOpenClick(existingId, isScoped) {
275276
276277 editorHtml.find('input, textarea, select').on('input', updateTestResult);
277278
278279 const popupResult = await callPopup(editorHtml, 'confirm', undefined, { okButton: 't`Save'` });
279280 if (popupResult) {
280281 const newRegexScript = {
281282 id: existingId ? String(existingId) : uuidv4(),
public/scripts/openai.js+4 -4
@@ -3608,8 +3608,8 @@ async function onExportPresetClick() {
36083608
36093609 const fieldValues = sensitiveFields.filter(field => preset[field]).map(field => `<b>${field}</b>: <code>${preset[field]}</code>`);
36103610 const shouldConfirm = fieldValues.length > 0;
36113611 const textHeader = 't`Your preset contains proxy and/or custom endpoint settings.'`;
36123612 const textMessage = `<div>` + t`Do you want to remove these fields before exporting?` + `</div><br>${DOMPurify.sanitize(fieldValues.join('<br>'))}`;
36133613 const cancelButton = { text: 'Cancel', result: POPUP_RESULT.CANCELLED, appendAtEnd: true };
36143614 const popupOptions = { customButtons: [cancelButton] };
36153615 const popupResult = await Popup.show.confirm(textHeader, textMessage, popupOptions);
@@ -4365,8 +4365,8 @@ async function onOpenrouterModelSortChange() {
43654365
43664366async function onNewPresetClick() {
43674367 const popupText = `
43684368 <h3>` + t`Preset name:` + `</h3>
43694369 <h4>` + t`Hint: Use a character/group name to bind preset to a specific chat.` + `</h4>`;
43704370 const name = await callPopup(popupText, 'input', oai_settings.preset_settings_openai);
43714371
43724372 if (!name) {
public/scripts/personas.js+32 -31
@@ -22,6 +22,7 @@ import { debounce_timeout } from './constants.js';
2222import { FILTER_TYPES, FilterHelper } from './filters.js';
2323import { selected_group } from './group-chats.js';
2424import { POPUP_RESULT, POPUP_TYPE, Popup } from './popup.js';
25+import { t } from './i18n.js';
2526
2627let savePersonasPage = 0;
2728const GRID_STORAGE_KEY = 'Personas_GridView';
@@ -276,7 +277,7 @@ async function changeUserAvatar(e) {
276277 let url = '/api/avatars/upload';
277278
278279 if (!power_user.never_resize_avatars) {
279280 const dlg = new Popup('t`Set the crop position of the avatar image'`, POPUP_TYPE.CROP, '', { cropImage: dataUrl });
280281 const result = await dlg.show();
281282
282283 if (!result) {
@@ -331,23 +332,23 @@ async function changeUserAvatar(e) {
331332 * @returns {Promise} Promise that resolves when the persona is set
332333 */
333334export async function createPersona(avatarId) {
334335 const personaName = await Popup.show.input('t`Enter a name for this persona:'`, 't`Cancel if you\'re just uploading an avatar.'`, '');
335336
336337 if (!personaName) {
337338 console.debug('User cancelled creating a persona');
338339 return;
339340 }
340341
341342 const personaDescription = await Popup.show.input('t`Enter a description for this persona:'`, 't`You can always add or change it later.'`, '', { rows: 4 });
342343
343344 initPersona(avatarId, personaName, personaDescription);
344345 if (power_user.persona_show_notifications) {
345346 toastr.success(t`You can now pick ${personaName} as a persona in the Persona Management menu.`, 't`Persona Created'`);
346347 }
347348}
348349
349350async function createDummyPersona() {
350351 const personaName = await Popup.show.input('t`Enter a name for this persona:'`, null);
351352
352353 if (!personaName) {
353354 console.debug('User cancelled creating dummy persona');
@@ -393,7 +394,7 @@ export async function convertCharacterToPersona(characterId = null) {
393394 const overwriteName = `${name} (Persona).png`;
394395
395396 if (overwriteName in power_user.personas) {
396397 const confirm = await Popup.show.confirm('t`Overwrite Existing Persona'`, 't`This character exists as a persona already. Do you want to overwrite it?'`);
397398 if (!confirm) {
398399 console.log('User cancelled the overwrite of the persona');
399400 return;
@@ -401,7 +402,7 @@ export async function convertCharacterToPersona(characterId = null) {
401402 }
402403
403404 if (description.includes('{{char}}') || description.includes('{{user}}')) {
404405 const confirm = await Popup.show.confirm('t`Persona Description Macros'`, 't`This character has a description that uses <code>{{char}}</code> or <code>{{user}}</code> macros. Do you want to swap them in the persona description?'`);
405406 if (confirm) {
406407 description = description.replace(/{{char}}/gi, '{{personaChar}}').replace(/{{user}}/gi, '{{personaUser}}');
407408 description = description.replace(/{{personaUser}}/gi, '{{char}}').replace(/{{personaChar}}/gi, '{{user}}');
@@ -427,7 +428,7 @@ export async function convertCharacterToPersona(characterId = null) {
427428 saveSettingsDebounced();
428429
429430 console.log('Persona for character created');
430431 toastr.success(t`You can now selectpick ${name} as a persona in the Persona Management menu.`, 't`Persona Created'`);
431432
432433 // Refresh the persona selector
433434 await getUserAvatars(true, overwriteName);
@@ -509,8 +510,8 @@ async function bindUserNameToPersona(e) {
509510 let personaUnbind = false;
510511 const existingPersona = power_user.personas[avatarId];
511512 const personaName = await Popup.show.input(
512513 't`Enter a name for this persona:'`,
513514 't`(If empty name is provided, this will unbind the name from this avatar)'`,
514515 existingPersona || '',
515516 { onClose: (p) => { personaUnbind = p.value === '' && p.result === POPUP_RESULT.AFFIRMATIVE; } });
516517
@@ -560,8 +561,8 @@ function selectCurrentPersona() {
560561 const lockedPersona = chat_metadata['persona'];
561562 if (lockedPersona && lockedPersona !== user_avatar && power_user.persona_show_notifications) {
562563 toastr.info(
563564 t`To permanently set "${personaName}" as the selected persona, unlock and relock it using the "Lock" button. Otherwise, the selection resets upon reloading the chat.`,
564565 t`This chat is locked to a different persona (${power_user.personas[lockedPersona]}).`,
565566 { timeOut: 10000, extendedTimeOut: 20000, preventDuplicates: true },
566567 );
567568 }
@@ -626,7 +627,7 @@ async function unlockPersona() {
626627 delete chat_metadata['persona'];
627628 await saveMetadata();
628629 if (power_user.persona_show_notifications) {
629630 toastr.info('t`User persona is now unlocked for this chat. Click the "Lock" again to revert.'`, 't`Persona unlocked'`);
630631 }
631632 updateUserLockIcon();
632633 }
@@ -640,8 +641,8 @@ async function lockPersona() {
640641 console.log(`Creating a new persona ${user_avatar}`);
641642 if (power_user.persona_show_notifications) {
642643 toastr.info(
643644 't`Creating a new persona for currently selected user name and avatar...'`,
644645 't`Persona not set for this avatar'`,
645646 { timeOut: 10000, extendedTimeOut: 20000 },
646647 );
647648 }
@@ -659,7 +660,7 @@ async function lockPersona() {
659660 saveSettingsDebounced();
660661 console.log(`Locking persona for this chat ${user_avatar}`);
661662 if (power_user.persona_show_notifications) {
662663 toastr.success(t`User persona is locked to ${name1} in this chat`);
663664 }
664665 updateUserLockIcon();
665666}
@@ -676,11 +677,11 @@ async function deleteUserAvatar(e) {
676677
677678 if (avatarId == user_avatar) {
678679 console.warn(`User tried to delete their current avatar ${avatarId}`);
679680 toastr.warning('t`You cannot delete the avatar you are currently using'`, 't`Warning'`);
680681 return;
681682 }
682683
683684 const confirm = await Popup.show.confirm('t`Are you sure you want to delete this avatar?'`, 't`All information associated with its linked persona will be lost.'`);
684685
685686 if (!confirm) {
686687 console.debug('User cancelled deleting avatar');
@@ -701,12 +702,12 @@ async function deleteUserAvatar(e) {
701702 delete power_user.persona_descriptions[avatarId];
702703
703704 if (avatarId === power_user.default_persona) {
704705 toastr.warning('t`The default persona was deleted. You will need to set a new default persona.'`, 't`Default persona deleted'`);
705706 power_user.default_persona = null;
706707 }
707708
708709 if (avatarId === chat_metadata['persona']) {
709710 toastr.warning('t`The locked persona was deleted. You will need to set a new persona for this chat.'`, 't`Persona deleted'`);
710711 delete chat_metadata['persona'];
711712 await saveMetadata();
712713 }
@@ -807,14 +808,14 @@ async function setDefaultPersona(e) {
807808
808809 if (power_user.personas[avatarId] === undefined) {
809810 console.warn(`No persona name found for avatar ${avatarId}`);
810811 toastr.warning('t`You must bind a name to this persona before you can set it as the default.'`, 't`Persona name not set'`);
811812 return;
812813 }
813814
814815 const personaName = power_user.personas[avatarId];
815816
816817 if (avatarId === currentDefault) {
817818 const confirm = await Popup.show.confirm('t`Are you sure you want to remove the default persona?'`, personaName);
818819
819820 if (!confirm) {
820821 console.debug('User cancelled removing default persona');
@@ -823,11 +824,11 @@ async function setDefaultPersona(e) {
823824
824825 console.log(`Removing default persona ${avatarId}`);
825826 if (power_user.persona_show_notifications) {
826827 toastr.info('t`This persona will no longer be used by default when you open a new chat.'`, 't`Default persona removed'`);
827828 }
828829 delete power_user.default_persona;
829830 } else {
830831 const confirm = await Popup.show.confirm(t`Are you sure you want to set "${personaName}" as the default persona?`, 't`This name and avatar will be used for all new chats, as well as existing chats where the user persona is not locked.'`);
831832
832833 if (!confirm) {
833834 console.debug('User cancelled setting default persona');
@@ -836,7 +837,7 @@ async function setDefaultPersona(e) {
836837
837838 power_user.default_persona = avatarId;
838839 if (power_user.persona_show_notifications) {
839840 toastr.success('t`This persona will be used by default when you open a new chat.'`, t`Default persona set to ${personaName}`);
840841 }
841842 }
842843
@@ -918,13 +919,13 @@ async function onPersonasRestoreInput(e) {
918919 const data = await parseJsonFile(file);
919920
920921 if (!data) {
921922 toastr.warning('t`Invalid file selected'`, 't`Persona Management'`);
922923 console.debug('Invalid file selected');
923924 return;
924925 }
925926
926927 if (!data.personas || !data.persona_descriptions || typeof data.personas !== 'object' || typeof data.persona_descriptions !== 'object') {
927928 toastr.warning('t`Invalid file format'`, 't`Persona Management'`);
928929 console.debug('Invalid file selected');
929930 return;
930931 }
@@ -972,10 +973,10 @@ async function onPersonasRestoreInput(e) {
972973 }
973974
974975 if (warnings.length) {
975976 toastr.success('t`Personas restored with warnings. Check console for details.'`);
976977 console.warn(`PERSONA RESTORE REPORT\n====================\n${warnings.join('\n')}`);
977978 } else {
978979 toastr.success('t`Personas restored successfully.'`);
979980 }
980981
981982 await getUserAvatars();
@@ -985,7 +986,7 @@ async function onPersonasRestoreInput(e) {
985986}
986987
987988async function syncUserNameToPersona() {
988989 const confirmation = await Popup.show.confirm('t`Are you sure?'`, t`All user-sent messages in this chat will be attributed to ${name1}.`);
989990
990991 if (!confirmation) {
991992 return;
@@ -1021,7 +1022,7 @@ async function duplicatePersona(avatarId) {
10211022 return;
10221023 }
10231024
10241025 const confirm = await Popup.show.confirm('t`Are you sure you want to duplicate this persona?'`, personaName);
10251026
10261027 if (!confirm) {
10271028 console.debug('User cancelled duplicating persona');
public/scripts/tags.js+3 -36
@@ -728,9 +728,9 @@ async function importTags(character, { importSetting = null } = {}) {
728728 const added = addTagsToEntity(tagsToImport, character.avatar);
729729
730730 if (added) {
731731 toastr.success(t`Imported tags:` + `<br />${tagsToImport.map(x => x.name).join(', ')}`, 't`Importing Tags'`, { escapeHtml: false });
732732 } else {
733733 toastr.error(t`Couldn't import tags:` + `<br />${tagsToImport.map(x => x.name).join(', ')}`, 't`Importing Tags'`, { escapeHtml: false });
734734 }
735735
736736 return added;
@@ -1299,40 +1299,7 @@ export function createTagInput(inputSelector, listSelector, tagListOptions = {})
12991299async function onViewTagsListClick() {
13001300 const html = $(document.createElement('div'));
13011301 html.attr('id', 'tag_view_list');
1302- html.append(`
1302+ html.append(await renderTemplateAsync('tagManagement', {bogus_folders: power_user.bogus_folders, auto_sort_tags: power_user.auto_sort_tags}));
1303- <div class="title_restorable alignItemsBaseline">
1304- <h3>Tag Management</h3>
1305- <div class="flex-container alignItemsBaseline">
1306- <div class="menu_button menu_button_icon tag_view_backup" title="Save your tags to a file">
1307- <i class="fa-solid fa-file-export"></i>
1308- <span data-i18n="Backup">Backup</span>
1309- </div>
1310- <div class="menu_button menu_button_icon tag_view_restore" title="Restore tags from a file">
1311- <i class="fa-solid fa-file-import"></i>
1312- <span data-i18n="Restore">Restore</span>
1313- </div>
1314- <div class="menu_button menu_button_icon tag_view_create" title="Create a new tag">
1315- <i class="fa-solid fa-plus"></i>
1316- <span data-i18n="Create">Create</span>
1317- </div>
1318- <input type="file" id="tag_view_restore_input" hidden accept=".json">
1319- </div>
1320- </div>
1321- <div class="justifyLeft m-b-1">
1322- <small>
1323- Drag handle to reorder. Click name to rename. Click color to change display.<br>
1324- ${(power_user.bogus_folders ? 'Click on the folder icon to use this tag as a folder.<br>' : '')}
1325- <label class="checkbox flex-container alignitemscenter flexNoGap m-t-1" for="auto_sort_tags">
1326- <input type="checkbox" id="auto_sort_tags" name="auto_sort_tags" ${power_user.auto_sort_tags ? ' checked' : ''} />
1327- <span data-i18n="Use alphabetical sorting">
1328- Use alphabetical sorting
1329- <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]If enabled, tags will automatically be sorted alphabetically on creation or rename.\nIf disabled, new tags will be appended at the end.\n\nIf a tag is manually reordered by dragging, automatic sorting will be disabled."
1330- title="If enabled, tags will automatically be sorted alphabetically on creation or rename.\nIf disabled, new tags will be appended at the end.\n\nIf a tag is manually reordered by dragging, automatic sorting will be disabled.">
1331- </div>
1332- </span>
1333- </label>
1334- </small>
1335- </div>`);
13361303
13371304 const tagContainer = $('<div class="tag_view_list_tags ui-sortable"></div>');
13381305 html.append(tagContainer);
public/scripts/templates/forbidMedia.html+2 -2
@@ -9,8 +9,8 @@
99 <input type="radio" id="forbid_media_override_global" name="forbid_media_override" />
1010 <span>
1111 <span data-i18n="Use global setting">Use global setting</span>
1212 <b data-i18n="forbid_media_global_state_forbidden" class="forbid_media_global_state_forbidden">(forbidden)</b>
1313 <b data-i18n="forbid_media_global_state_allowed" class="forbid_media_global_state_allowed">(allowed)</b>
1414 </span>
1515 </label>
1616 <label class="checkbox_label" for="forbid_media_override_forbidden">
public/scripts/templates/tagManagement.html+33 -0
@@ -0,0 +1,33 @@
1+<div class="title_restorable alignItemsBaseline">
2+ <h3 data-i18n="Tag Management">Tag Management</h3>
3+ <div class="flex-container alignItemsBaseline">
4+ <div class="menu_button menu_button_icon tag_view_backup" data-i18n="[title]Save your tags to a file" title="Save your tags to a file">
5+ <i class="fa-solid fa-file-export"></i>
6+ <span data-i18n="Backup">Backup</span>
7+ </div>
8+ <div class="menu_button menu_button_icon tag_view_restore" data-i18n="[title]Restore tags from a file" title="Restore tags from a file">
9+ <i class="fa-solid fa-file-import"></i>
10+ <span data-i18n="Restore">Restore</span>
11+ </div>
12+ <div class="menu_button menu_button_icon tag_view_create" data-i18n="[title]Create a new tag" title="Create a new tag">
13+ <i class="fa-solid fa-plus"></i>
14+ <span data-i18n="Create">Create</span>
15+ </div>
16+ <input type="file" id="tag_view_restore_input" hidden accept=".json">
17+ </div>
18+ </div>
19+ <div class="justifyLeft m-b-1">
20+ <small>
21+ <span data-i18n="Drag handle to reorder. Click name to rename. Click color to change display.">Drag handle to reorder. Click name to rename. Click color to change display.</span><br>
22+ {{#if bogus_folders}}<span data-i18n="Click on the folder icon to use this tag as a folder.">Click on the folder icon to use this tag as a folder.</span><br>{{/if}}
23+ <label class="checkbox flex-container alignitemscenter flexNoGap m-t-1" for="auto_sort_tags">
24+ <input type="checkbox" id="auto_sort_tags" name="auto_sort_tags" {{#if auto_sort_tags}} checked{{/if}} />
25+ <span data-i18n="Use alphabetical sorting">
26+ Use alphabetical sorting
27+ </span>
28+ <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]tags_sorting_desc"
29+ title="If enabled, tags will automatically be sorted alphabetically on creation or rename.\nIf disabled, new tags will be appended at the end.\n\nIf a tag is manually reordered by dragging, automatic sorting will be disabled.">
30+ </div>
31+ </label>
32+ </small>
33+ </div>
33 \ No newline at end of file
public/scripts/templates/welcome.html+1 -1
@@ -33,7 +33,7 @@
3333 <i class="fa-solid fa-image-portrait"></i>
3434 <span data-i18n="Sample characters">Sample characters</span>
3535 </button>
3636 <span data-i18n="or;or_welcome">or</span>
3737 <button class="external_import_button menu_button menu_button_icon inline-flex">
3838 <i class="fa-solid fa-cloud-arrow-down"></i>
3939 <span data-i18n="Import Characters">Import characters</span>