caption: update for new popup
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | import { ensureImageFormatSupported, getBase64Async, isTrueBoolean, saveBase64AsFile } from '../../utils.js'; |
| 2 | 2 | import { getContext, getApiUrl, doExtrasFetch, extension_settings, modules, renderExtensionTemplateAsync } from '../../extensions.js'; |
| 3 | 3 | import { appendMediaToMessage, callPopup, eventSource, event_types, getRequestHeaders, saveChatConditional, saveSettingsDebounced, substituteParamsExtended } from '../../../script.js'; |
| 4 | 4 | import { getMessageTimeStamp } from '../../RossAscends-mods.js'; |
| 5 | 5 | import { SECRET_KEYS, secret_state } from '../../secrets.js'; |
| 6 | 6 | import { getMultimodalCaption } from '../shared.js'; |
| @@ -9,6 +9,7 @@ import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js'; | ||
| 9 | 9 | import { SlashCommand } from '../../slash-commands/SlashCommand.js'; |
| 10 | 10 | import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js'; |
| 11 | 11 | import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js'; |
| 12 | +import { callGenericPopup, Popup, POPUP_TYPE } from '../../popup.js'; | |
| 12 | 13 | export { MODULE_NAME }; |
| 13 | 14 | |
| 14 | 15 | const MODULE_NAME = 'caption'; |
| @@ -98,9 +99,9 @@ async function wrapCaptionTemplate(caption) { | ||
| 98 | 99 | let messageText = substituteParamsExtended(template, { caption: caption }); |
| 99 | 100 | |
| 100 | 101 | if (extension_settings.caption.refine_mode) { |
| 101 | 102 | messageText = await callPopupPopup.show.input( |
| 102 | 103 | '<h3>Review and edit the generated caption:</h3>Press "Cancel" to abort the caption sending.', |
| 103 | - 'input', | |
| 104 | + 'Press "Cancel" to abort the caption sending.', | |
| 104 | 105 | messageText, |
| 105 | 106 | { rows: 5, okButton: 'Send' }); |
| 106 | 107 | |
| @@ -278,7 +279,7 @@ async function captionMultimodal(base64Img, externalPrompt) { | ||
| 278 | 279 | let prompt = externalPrompt || extension_settings.caption.prompt || PROMPT_DEFAULT; |
| 279 | 280 | |
| 280 | 281 | if (!externalPrompt && extension_settings.caption.prompt_ask) { |
| 281 | 282 | const customPrompt = await callPopupcallGenericPopup('<h3>Enter a comment or question:</h3>', 'input'POPUP_TYPE.INPUT, prompt, { rows: 2 }); |
| 282 | 283 | if (!customPrompt) { |
| 283 | 284 | throw new Error('User aborted the caption sending.'); |
| 284 | 285 | } |