#2482 Fix embedded content confirmation

6dbbf89d659db34375e094e7b67b825a982af9b2

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +8 -8Ignore whitespace
public/scripts/extensions/regex/index.js+6 -6
@@ -1,13 +1,13 @@
11import { callPopup, characters, eventSource, event_types, getCurrentChatId, reloadCurrentChat, saveSettingsDebounced, this_chid } from '../../../script.js';
22import { extension_settings, renderExtensionTemplateAsync, writeExtensionField } from '../../extensions.js';
33import { selected_group } from '../../group-chats.js';
4+import { callGenericPopup, POPUP_TYPE } from '../../popup.js';
45import { SlashCommand } from '../../slash-commands/SlashCommand.js';
56import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js';
67import { enumIcons } from '../../slash-commands/SlashCommandCommonEnumsProvider.js';
78import { SlashCommandEnumValue, enumTypes } from '../../slash-commands/SlashCommandEnumValue.js';
89import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
910import { download, getFileText, getSortableDelay, uuidv4 } from '../../utils.js';
10-import { resolveVariable } from '../../variables.js';
1111import { regex_placement, runRegexScript } from './engine.js';
1212
1313/**
@@ -141,7 +141,7 @@ async function loadRegexScripts() {
141141 await onRegexEditorOpenClick(scriptHtml.attr('id'), isScoped);
142142 });
143143 scriptHtml.find('.move_to_global').on('click', async function () {
144144 const confirm = await callPopupcallGenericPopup('Are you sure you want to move this regex script to global?', 'confirm'POPUP_TYPE.CONFIRM);
145145
146146 if (!confirm) {
147147 return;
@@ -161,7 +161,7 @@ async function loadRegexScripts() {
161161 return;
162162 }
163163
164164 const confirm = await callPopupcallGenericPopup('Are you sure you want to move this regex script to scoped?', 'confirm'POPUP_TYPE.CONFIRM);
165165
166166 if (!confirm) {
167167 return;
@@ -176,7 +176,7 @@ async function loadRegexScripts() {
176176 download(fileData, fileName, 'application/json');
177177 });
178178 scriptHtml.find('.delete_regex').on('click', async function () {
179179 const confirm = await callPopupcallGenericPopup('Are you sure you want to delete this regex script?', 'confirm'POPUP_TYPE.CONFIRM);
180180
181181 if (!confirm) {
182182 return;
@@ -442,7 +442,7 @@ async function checkEmbeddedRegexScripts() {
442442 if (!localStorage.getItem(checkKey)) {
443443 localStorage.setItem(checkKey, 'true');
444444 const template = await renderExtensionTemplateAsync('regex', 'embeddedScripts', {});
445445 const result = await callPopupcallGenericPopup(template, 'confirm'POPUP_TYPE.CONFIRM, '', { okButton: 'Yes' });
446446
447447 if (result) {
448448 extension_settings.character_allowed_regex.push(avatar);
@@ -493,7 +493,7 @@ jQuery(async () => {
493493 template.find('#regex_import_target_global').on('input', () => target = 'global');
494494 template.find('#regex_import_target_scoped').on('input', () => target = 'scoped');
495495
496496 await callPopupcallGenericPopup(template, 'text'POPUP_TYPE.TEXT);
497497
498498 const inputElement = this instanceof HTMLInputElement && this;
499499 for (const file of inputElement.files) {
public/scripts/world-info.js+2 -2
@@ -16,7 +16,7 @@ import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandE
1616import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
1717import { SlashCommandExecutor } from './slash-commands/SlashCommandExecutor.js';
1818import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js';
1919import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js';
2020
2121export {
2222 world_info,
@@ -4224,7 +4224,7 @@ export function checkEmbeddedWorld(chid) {
42244224 importEmbeddedWorldInfo(true);
42254225 }
42264226 };
42274227 callPopupcallGenericPopup(html, 'confirm'POPUP_TYPE.CONFIRM, '', { okButton: 'Yes' }).then(checkResult);
42284228 }
42294229 else {
42304230 toastr.info(