mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/SillyLossy/TavernAI into dev
This commit is contained in:
@@ -124,6 +124,26 @@ function showBookmarksButtons() {
|
||||
}
|
||||
|
||||
async function createNewBookmark() {
|
||||
if (!chat.length) {
|
||||
toastr.warning('The chat is empty.', 'Bookmark creation failed');
|
||||
return;
|
||||
}
|
||||
|
||||
const mesId = chat.length - 1;
|
||||
const lastMes = chat[mesId];
|
||||
|
||||
if (typeof lastMes.extra !== 'object') {
|
||||
lastMes.extra = {};
|
||||
}
|
||||
|
||||
if (lastMes.extra.bookmark_link) {
|
||||
const confirm = await callPopup('Bookmark checkpoint for the last message already exists. Would you like to replace it?', 'confirm');
|
||||
|
||||
if (!confirm) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let name = await getBookmarkName();
|
||||
|
||||
if (!name) {
|
||||
@@ -139,9 +159,11 @@ async function createNewBookmark() {
|
||||
await saveChat(name, newMetadata);
|
||||
}
|
||||
|
||||
let mainMessage = stringFormat(system_messages[system_message_types.BOOKMARK_CREATED].mes, name, name);
|
||||
sendSystemMessage(system_message_types.BOOKMARK_CREATED, mainMessage);
|
||||
lastMes.extra['bookmark_link'] = name;
|
||||
$(`.mes[mesid="${mesId}"]`).attr('bookmark_link', name);
|
||||
|
||||
await saveChatConditional();
|
||||
toastr.success('Click the bookmark icon in the last message to open the checkpoint chat.', 'Bookmark created', { timeOut: 10000 });
|
||||
}
|
||||
|
||||
async function backToMainChat() {
|
||||
|
@@ -11,15 +11,7 @@ function openContextTemplateEditor() {
|
||||
function copyTemplateParameter(event) {
|
||||
const text = $(event.target).text();
|
||||
navigator.clipboard.writeText(text);
|
||||
const copiedMsg = document.createElement("div");
|
||||
copiedMsg.classList.add('code-copied');
|
||||
copiedMsg.innerText = "Copied!";
|
||||
copiedMsg.style.top = `${event.clientY - 55}px`;
|
||||
copiedMsg.style.left = `${event.clientX - 55}px`;
|
||||
document.body.append(copiedMsg);
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(copiedMsg);
|
||||
}, 1000);
|
||||
toastr.info('Copied!', '', { timeOut: 2000 });
|
||||
}
|
||||
|
||||
jQuery(() => {
|
||||
|
@@ -174,6 +174,7 @@ function debugTtsPlayback() {
|
||||
"audioQueueProcessorReady": audioQueueProcessorReady,
|
||||
"ttsJobQueue": ttsJobQueue,
|
||||
"currentTtsJob": currentTtsJob,
|
||||
"ttsConfig": extension_settings.tts
|
||||
}
|
||||
))
|
||||
}
|
||||
@@ -372,6 +373,7 @@ async function processTtsQueue() {
|
||||
try {
|
||||
if (!text) {
|
||||
console.warn('Got empty text in TTS queue job.');
|
||||
completeTtsJob()
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user