mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-06 04:38:21 +01:00
Merge branch 'staging' into wi-regex-keys
This commit is contained in:
commit
1e2d1aa118
@ -3998,8 +3998,8 @@
|
|||||||
|
|
||||||
<div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]The number of chat history messages to load before pagination." title="The number of chat history messages to load before pagination."></div>
|
<div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]The number of chat history messages to load before pagination." title="The number of chat history messages to load before pagination."></div>
|
||||||
</small>
|
</small>
|
||||||
<input class="neo-range-slider" type="range" id="chat_truncation" name="chat_truncation" min="0" max="1000" step="25">
|
<input class="neo-range-slider" type="range" id="chat_truncation" name="chat_truncation" min="0" max="1000" step="5">
|
||||||
<input class="neo-range-input" type="number" min="0" max="1000" step="25" data-for="chat_truncation" id="chat_truncation_counter">
|
<input class="neo-range-input" type="number" min="0" max="1000" step="5" data-for="chat_truncation" id="chat_truncation_counter">
|
||||||
<small data-i18n="(0 = All)">(0 = All)</small>
|
<small data-i18n="(0 = All)">(0 = All)</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8292,6 +8292,23 @@ async function doDeleteChat() {
|
|||||||
$('#dialogue_popup_ok').trigger('click', { fromSlashCommand: true });
|
$('#dialogue_popup_ok').trigger('click', { fromSlashCommand: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function doRenameChat(_, chatName) {
|
||||||
|
if (!chatName) {
|
||||||
|
toastr.warning('Name must be provided as an argument to rename this chat.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentChatName = getCurrentChatId();
|
||||||
|
if (!currentChatName) {
|
||||||
|
toastr.warning('No chat selected that can be renamed.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await renameChat(currentChatName, chatName);
|
||||||
|
|
||||||
|
toastr.success(`Successfully renamed chat to: ${chatName}`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renames the currently selected chat.
|
* Renames the currently selected chat.
|
||||||
* @param {string} oldFileName Old name of the chat (no JSONL extension)
|
* @param {string} oldFileName Old name of the chat (no JSONL extension)
|
||||||
@ -8583,6 +8600,16 @@ jQuery(async function () {
|
|||||||
callback: doDeleteChat,
|
callback: doDeleteChat,
|
||||||
helpString: 'Deletes the current chat.',
|
helpString: 'Deletes the current chat.',
|
||||||
}));
|
}));
|
||||||
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
|
name: 'renamechat',
|
||||||
|
callback: doRenameChat,
|
||||||
|
unnamedArgumentList: [
|
||||||
|
new SlashCommandArgument(
|
||||||
|
'new chat name', [ARGUMENT_TYPE.STRING], true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
helpString: 'Renames the current chat.',
|
||||||
|
}));
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'getchatname',
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'getchatname',
|
||||||
callback: doGetChatName,
|
callback: doGetChatName,
|
||||||
returns: 'chat file name',
|
returns: 'chat file name',
|
||||||
@ -8592,6 +8619,11 @@ jQuery(async function () {
|
|||||||
callback: doCloseChat,
|
callback: doCloseChat,
|
||||||
helpString: 'Closes the current chat.',
|
helpString: 'Closes the current chat.',
|
||||||
}));
|
}));
|
||||||
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
|
name: 'closechat',
|
||||||
|
callback: doCloseChat,
|
||||||
|
helpString: 'Closes the current chat.',
|
||||||
|
}));
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'panels',
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'panels',
|
||||||
callback: doTogglePanels,
|
callback: doTogglePanels,
|
||||||
aliases: ['togglepanels'],
|
aliases: ['togglepanels'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user