openai.js: update for new popup

This commit is contained in:
Cohee
2025-06-02 23:44:50 +03:00
parent d7c938a294
commit 55b3016985

View File

@@ -71,7 +71,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
import { renderTemplateAsync } from './templates.js';
import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';
import { Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';
import { callGenericPopup, Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';
import { t } from './i18n.js';
import { ToolManager } from './tool-calling.js';
import { accountStorage } from './util/AccountStorage.js';
@@ -4084,7 +4084,7 @@ async function onPresetImportFileChange(e) {
}
if (name in openai_setting_names) {
const confirm = await callPopup('Preset name already exists. Overwrite?', 'confirm');
const confirm = await callGenericPopup('Preset name already exists. Overwrite?', POPUP_TYPE.CONFIRM);
if (!confirm) {
return;
@@ -4220,7 +4220,7 @@ function onLogitBiasPresetExportClick() {
}
async function onDeletePresetClick() {
const confirm = await callPopup(t`Delete the preset? This action is irreversible and your current settings will be overwritten.`, 'confirm');
const confirm = await callGenericPopup(t`Delete the preset? This action is irreversible and your current settings will be overwritten.`, POPUP_TYPE.CONFIRM);
if (!confirm) {
return;
@@ -4255,7 +4255,7 @@ async function onDeletePresetClick() {
}
async function onLogitBiasPresetDeleteClick() {
const value = await callPopup(t`Delete the preset?`, 'confirm');
const value = await callGenericPopup(t`Delete the preset?`, POPUP_TYPE.CONFIRM);
if (!value) {
return;
@@ -4960,10 +4960,7 @@ async function onOpenrouterModelSortChange() {
}
async function onNewPresetClick() {
const popupText = `
<h3>` + t`Preset name:` + `</h3>
<h4>` + t`Hint: Use a character/group name to bind preset to a specific chat.` + '</h4>';
const name = await callPopup(popupText, 'input', oai_settings.preset_settings_openai);
const name = await Popup.show.input(t`Preset name:`, t`Hint: Use a character/group name to bind preset to a specific chat.`, oai_settings.preset_settings_openai);
if (!name) {
return;
@@ -5348,7 +5345,7 @@ async function onCustomizeParametersClick() {
saveSettingsDebounced();
});
callPopup(template, 'text', '', { wide: true, large: true });
await callGenericPopup(template, POPUP_TYPE.TEXT, '', { wide: true, large: true });
}
/**