caption: update for new popup

b901ed1be761d47361003215d146dc23a2d049e4

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

1 files changed, +6 -5Ignore whitespace
public/scripts/extensions/caption/index.js+6 -5
@@ -1,6 +1,6 @@
11import { ensureImageFormatSupported, getBase64Async, isTrueBoolean, saveBase64AsFile } from '../../utils.js';
22import { getContext, getApiUrl, doExtrasFetch, extension_settings, modules, renderExtensionTemplateAsync } from '../../extensions.js';
33import { appendMediaToMessage, callPopup, eventSource, event_types, getRequestHeaders, saveChatConditional, saveSettingsDebounced, substituteParamsExtended } from '../../../script.js';
44import { getMessageTimeStamp } from '../../RossAscends-mods.js';
55import { SECRET_KEYS, secret_state } from '../../secrets.js';
66import { getMultimodalCaption } from '../shared.js';
@@ -9,6 +9,7 @@ import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
99import { SlashCommand } from '../../slash-commands/SlashCommand.js';
1010import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js';
1111import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js';
12+import { callGenericPopup, Popup, POPUP_TYPE } from '../../popup.js';
1213export { MODULE_NAME };
1314
1415const MODULE_NAME = 'caption';
@@ -98,9 +99,9 @@ async function wrapCaptionTemplate(caption) {
9899 let messageText = substituteParamsExtended(template, { caption: caption });
99100
100101 if (extension_settings.caption.refine_mode) {
101102 messageText = await callPopupPopup.show.input(
102103 '<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.',
104105 messageText,
105106 { rows: 5, okButton: 'Send' });
106107
@@ -278,7 +279,7 @@ async function captionMultimodal(base64Img, externalPrompt) {
278279 let prompt = externalPrompt || extension_settings.caption.prompt || PROMPT_DEFAULT;
279280
280281 if (!externalPrompt && extension_settings.caption.prompt_ask) {
281282 const customPrompt = await callPopupcallGenericPopup('<h3>Enter a comment or question:</h3>', 'input'POPUP_TYPE.INPUT, prompt, { rows: 2 });
282283 if (!customPrompt) {
283284 throw new Error('User aborted the caption sending.');
284285 }