mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Optional delete message confirmation
This commit is contained in:
@@ -2344,6 +2344,9 @@
|
|||||||
<label for="import_card_tags"><input id="import_card_tags" type="checkbox" />
|
<label for="import_card_tags"><input id="import_card_tags" type="checkbox" />
|
||||||
<span data-i18n="Import Card Tags">Import Card Tags</span>
|
<span data-i18n="Import Card Tags">Import Card Tags</span>
|
||||||
</label>
|
</label>
|
||||||
|
<label for="confirm_message_delete"><input id="confirm_message_delete" type="checkbox" />
|
||||||
|
<span data-i18n="Confirm message deletion">Confirm message deletion</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
<div class="inline-drawer wide100p flexFlowColumn">
|
<div class="inline-drawer wide100p flexFlowColumn">
|
||||||
<div class="inline-drawer-toggle inline-drawer-header">
|
<div class="inline-drawer-toggle inline-drawer-header">
|
||||||
|
@@ -7672,9 +7672,11 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
$(document).on("click", ".mes_edit_delete", async function () {
|
$(document).on("click", ".mes_edit_delete", async function () {
|
||||||
const confirmation = await callPopup("Are you sure you want to delete this message?", 'confirm');
|
if (power_user.confirm_message_delete) {
|
||||||
if (!confirmation) {
|
const confirmation = await callPopup("Are you sure you want to delete this message?", 'confirm');
|
||||||
return;
|
if (!confirmation) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mes = $(this).closest(".mes");
|
const mes = $(this).closest(".mes");
|
||||||
|
@@ -632,6 +632,7 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
$(`#pygmalion_formatting option[value=${power_user.pygmalion_formatting}]`).attr("selected", true);
|
$(`#pygmalion_formatting option[value=${power_user.pygmalion_formatting}]`).attr("selected", true);
|
||||||
$(`#send_on_enter option[value=${power_user.send_on_enter}]`).attr("selected", true);
|
$(`#send_on_enter option[value=${power_user.send_on_enter}]`).attr("selected", true);
|
||||||
$("#import_card_tags").prop("checked", power_user.import_card_tags);
|
$("#import_card_tags").prop("checked", power_user.import_card_tags);
|
||||||
|
$("#confirm_message_delete").prop("checked", power_user.confirm_message_delete !== undefined ? !!power_user.confirm_message_delete : true);
|
||||||
$("#collapse-newlines-checkbox").prop("checked", power_user.collapse_newlines);
|
$("#collapse-newlines-checkbox").prop("checked", power_user.collapse_newlines);
|
||||||
$("#pin-examples-checkbox").prop("checked", power_user.pin_examples);
|
$("#pin-examples-checkbox").prop("checked", power_user.pin_examples);
|
||||||
$("#disable-description-formatting-checkbox").prop("checked", power_user.disable_description_formatting);
|
$("#disable-description-formatting-checkbox").prop("checked", power_user.disable_description_formatting);
|
||||||
@@ -1697,6 +1698,11 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#confirm_message_delete").on('input', function () {
|
||||||
|
power_user.confirm_message_delete = !!$(this).prop('checked');
|
||||||
|
saveSettingsDebounced();
|
||||||
|
});
|
||||||
|
|
||||||
$("#render_formulas").on("input", function () {
|
$("#render_formulas").on("input", function () {
|
||||||
power_user.render_formulas = !!$(this).prop('checked');
|
power_user.render_formulas = !!$(this).prop('checked');
|
||||||
reloadMarkdownProcessor(power_user.render_formulas);
|
reloadMarkdownProcessor(power_user.render_formulas);
|
||||||
|
Reference in New Issue
Block a user