#2482 Fix embedded content confirmation
| @@ -1,13 +1,13 @@ | ||
| 1 | 1 | import { callPopup, characters, eventSource, event_types, getCurrentChatId, reloadCurrentChat, saveSettingsDebounced, this_chid } from '../../../script.js'; |
| 2 | 2 | import { extension_settings, renderExtensionTemplateAsync, writeExtensionField } from '../../extensions.js'; |
| 3 | 3 | import { selected_group } from '../../group-chats.js'; |
| 4 | +import { callGenericPopup, POPUP_TYPE } from '../../popup.js'; | |
| 4 | 5 | import { SlashCommand } from '../../slash-commands/SlashCommand.js'; |
| 5 | 6 | import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js'; |
| 6 | 7 | import { enumIcons } from '../../slash-commands/SlashCommandCommonEnumsProvider.js'; |
| 7 | 8 | import { SlashCommandEnumValue, enumTypes } from '../../slash-commands/SlashCommandEnumValue.js'; |
| 8 | 9 | import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js'; |
| 9 | 10 | import { download, getFileText, getSortableDelay, uuidv4 } from '../../utils.js'; |
| 10 | -import { resolveVariable } from '../../variables.js'; | |
| 11 | 11 | import { regex_placement, runRegexScript } from './engine.js'; |
| 12 | 12 | |
| 13 | 13 | /** |
| @@ -141,7 +141,7 @@ async function loadRegexScripts() { | ||
| 141 | 141 | await onRegexEditorOpenClick(scriptHtml.attr('id'), isScoped); |
| 142 | 142 | }); |
| 143 | 143 | scriptHtml.find('.move_to_global').on('click', async function () { |
| 144 | 144 | const confirm = await callPopupcallGenericPopup('Are you sure you want to move this regex script to global?', 'confirm'POPUP_TYPE.CONFIRM); |
| 145 | 145 | |
| 146 | 146 | if (!confirm) { |
| 147 | 147 | return; |
| @@ -161,7 +161,7 @@ async function loadRegexScripts() { | ||
| 161 | 161 | return; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | const confirm = await callPopupcallGenericPopup('Are you sure you want to move this regex script to scoped?', 'confirm'POPUP_TYPE.CONFIRM); |
| 165 | 165 | |
| 166 | 166 | if (!confirm) { |
| 167 | 167 | return; |
| @@ -176,7 +176,7 @@ async function loadRegexScripts() { | ||
| 176 | 176 | download(fileData, fileName, 'application/json'); |
| 177 | 177 | }); |
| 178 | 178 | scriptHtml.find('.delete_regex').on('click', async function () { |
| 179 | 179 | const confirm = await callPopupcallGenericPopup('Are you sure you want to delete this regex script?', 'confirm'POPUP_TYPE.CONFIRM); |
| 180 | 180 | |
| 181 | 181 | if (!confirm) { |
| 182 | 182 | return; |
| @@ -442,7 +442,7 @@ async function checkEmbeddedRegexScripts() { | ||
| 442 | 442 | if (!localStorage.getItem(checkKey)) { |
| 443 | 443 | localStorage.setItem(checkKey, 'true'); |
| 444 | 444 | const template = await renderExtensionTemplateAsync('regex', 'embeddedScripts', {}); |
| 445 | 445 | const result = await callPopupcallGenericPopup(template, 'confirm'POPUP_TYPE.CONFIRM, '', { okButton: 'Yes' }); |
| 446 | 446 | |
| 447 | 447 | if (result) { |
| 448 | 448 | extension_settings.character_allowed_regex.push(avatar); |
| @@ -493,7 +493,7 @@ jQuery(async () => { | ||
| 493 | 493 | template.find('#regex_import_target_global').on('input', () => target = 'global'); |
| 494 | 494 | template.find('#regex_import_target_scoped').on('input', () => target = 'scoped'); |
| 495 | 495 | |
| 496 | 496 | await callPopupcallGenericPopup(template, 'text'POPUP_TYPE.TEXT); |
| 497 | 497 | |
| 498 | 498 | const inputElement = this instanceof HTMLInputElement && this; |
| 499 | 499 | for (const file of inputElement.files) { |
| @@ -16,7 +16,7 @@ import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandE | ||
| 16 | 16 | import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js'; |
| 17 | 17 | import { SlashCommandExecutor } from './slash-commands/SlashCommandExecutor.js'; |
| 18 | 18 | import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js'; |
| 19 | 19 | import { callGenericPopup, Popup, POPUP_TYPE } from './popup.js'; |
| 20 | 20 | |
| 21 | 21 | export { |
| 22 | 22 | world_info, |
| @@ -4224,7 +4224,7 @@ export function checkEmbeddedWorld(chid) { | ||
| 4224 | 4224 | importEmbeddedWorldInfo(true); |
| 4225 | 4225 | } |
| 4226 | 4226 | }; |
| 4227 | 4227 | callPopupcallGenericPopup(html, 'confirm'POPUP_TYPE.CONFIRM, '', { okButton: 'Yes' }).then(checkResult); |
| 4228 | 4228 | } |
| 4229 | 4229 | else { |
| 4230 | 4230 | toastr.info( |