Move ctrl+enter regenerate to new popup

This commit is contained in:
Wolfsblvt 2024-06-26 05:46:34 +02:00
parent ff5f89bd5e
commit ec58d9272a
1 changed files with 15 additions and 15 deletions

View File

@ -16,7 +16,6 @@ import {
eventSource, eventSource,
menu_type, menu_type,
substituteParams, substituteParams,
callPopup,
sendTextareaMessage, sendTextareaMessage,
} from '../script.js'; } from '../script.js';
@ -1004,20 +1003,21 @@ export function initRossMods() {
if (skipConfirm) { if (skipConfirm) {
doRegenerate(); doRegenerate();
} else { } else {
const popupText = ` Popup.show.confirm('Regenerate Message', `
<div class="marginBot10">Are you sure you want to regenerate the latest message?</div> <span>Are you sure you want to regenerate the latest message?</span>
<label class="checkbox_label justifyCenter" for="regenerateWithCtrlEnter"> <label class="checkbox_label justifyCenter marginTop10" for="regenerateWithCtrlEnter">
<input type="checkbox" id="regenerateWithCtrlEnter"> <input type="checkbox" id="regenerateWithCtrlEnter">
Don't ask again Don't ask again
</label>`; </label>`, {
callPopup(popupText, 'confirm').then(result => { onClose: (popup) => {
if (!result) { if (!popup.result) {
return; return;
} }
const regenerateWithCtrlEnter = $('#regenerateWithCtrlEnter').prop('checked'); const regenerateWithCtrlEnter = $('#regenerateWithCtrlEnter').prop('checked');
SaveLocal(skipConfirmKey, regenerateWithCtrlEnter); SaveLocal(skipConfirmKey, regenerateWithCtrlEnter);
doRegenerate(); doRegenerate();
}); },
})
} }
return; return;
} else { } else {