move closechat/togglepanels to slashcommands

This commit is contained in:
RossAscends 2023-08-03 13:21:38 +09:00
parent f198f5eb6e
commit 68e5ae63d6
2 changed files with 29 additions and 20 deletions

View File

@ -2145,9 +2145,7 @@
Match whole words
</small>
</label>
<label title="Alert if your world info is greater than the allocated budget."
data-i18n="[title]Alert if your world info is greater than the allocated budget."
class="checkbox_label">
<label title="Alert if your world info is greater than the allocated budget." data-i18n="[title]Alert if your world info is greater than the allocated budget." class="checkbox_label">
<input id="world_info_overflow_alert" type="checkbox" />
<small data-i18n="Alert On Overflow">
Alert On Overflow
@ -3782,11 +3780,11 @@
<!-- popups live outside sheld to avoid blur conflicts -->
<div id="options" class="font-family-reset" style="display: none;">
<div class="options-content">
<a id="option_close_chat">
<a id="option_close_chat" class="displayNone">
<i class="fa-lg fa-solid fa-times"></i>
<span data-i18n="Close chat">Close chat</span>
</a>
<a id="option_settings">
<a id="option_settings" class="displayNone">
<i class="fa-lg fa-solid fa-cog"></i>
<span data-i18n="Toggle Panels">Toggle Panels</span>
</a>

View File

@ -6954,6 +6954,10 @@ function doCharListDisplaySwitch() {
updateVisibleDivs('#rm_print_characters_block', true);
}
function doCloseChat() {
$("#option_close_chat").trigger('click')
}
/**
* Function to handle the deletion of a character, given a specific popup type and character ID.
* If popup type equals "del_ch", it will proceed with deletion otherwise it will exit the function.
@ -7020,6 +7024,10 @@ export async function deleteCharacter(name, avatar) {
saveSettingsDebounced();
}
function doTogglePanels() {
$("#option_settings").trigger('click')
}
$(document).ready(function () {
@ -7034,6 +7042,9 @@ $(document).ready(function () {
registerSlashCommand('api', connectAPISlash, [], "(kobold, horde, novel, ooba, oai, claude, windowai) connect to an API", true, true);
registerSlashCommand('impersonate', doImpersonate, ['imp'], "- calls an impersonation response", true, true);
registerSlashCommand('delchat', doDeleteChat, [], "- deletes the current chat", true, true);
registerSlashCommand('closechat', doCloseChat, [], "- closes the current chat", true, true);
registerSlashCommand('panels', doTogglePanels, ['togglepanels'], "- toggle UI panels on/off", true, true);
setTimeout(function () {