openai.js: update for new popup

55b3016985398286e3dfd43674998910ef16896a

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

1 files changed, +6 -9Showing whitespace changes
public/scripts/openai.js+6 -9
@@ -71,7 +71,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
71import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';71import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
72import { renderTemplateAsync } from './templates.js';72import { renderTemplateAsync } from './templates.js';
73import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';73import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';
74import { Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';74import { callGenericPopup, Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';
75import { t } from './i18n.js';75import { t } from './i18n.js';
76import { ToolManager } from './tool-calling.js';76import { ToolManager } from './tool-calling.js';
77import { accountStorage } from './util/AccountStorage.js';77import { accountStorage } from './util/AccountStorage.js';
@@ -4084,7 +4084,7 @@ async function onPresetImportFileChange(e) {
4084 }4084 }
40854085
4086 if (name in openai_setting_names) {4086 if (name in openai_setting_names) {
4087 const confirm = await callPopup('Preset name already exists. Overwrite?', 'confirm');4087 const confirm = await callGenericPopup('Preset name already exists. Overwrite?', POPUP_TYPE.CONFIRM);
40884088
4089 if (!confirm) {4089 if (!confirm) {
4090 return;4090 return;
@@ -4220,7 +4220,7 @@ function onLogitBiasPresetExportClick() {
4220}4220}
42214221
4222async function onDeletePresetClick() {4222async function onDeletePresetClick() {
4223 const confirm = await callPopup(t`Delete the preset? This action is irreversible and your current settings will be overwritten.`, 'confirm');4223 const confirm = await callGenericPopup(t`Delete the preset? This action is irreversible and your current settings will be overwritten.`, POPUP_TYPE.CONFIRM);
42244224
4225 if (!confirm) {4225 if (!confirm) {
4226 return;4226 return;
@@ -4255,7 +4255,7 @@ async function onDeletePresetClick() {
4255}4255}
42564256
4257async function onLogitBiasPresetDeleteClick() {4257async function onLogitBiasPresetDeleteClick() {
4258 const value = await callPopup(t`Delete the preset?`, 'confirm');4258 const value = await callGenericPopup(t`Delete the preset?`, POPUP_TYPE.CONFIRM);
42594259
4260 if (!value) {4260 if (!value) {
4261 return;4261 return;
@@ -4960,10 +4960,7 @@ async function onOpenrouterModelSortChange() {
4960}4960}
49614961
4962async function onNewPresetClick() {4962async function onNewPresetClick() {
4963 const popupText = `4963 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);
4964 <h3>` + t`Preset name:` + `</h3>
4965 <h4>` + t`Hint: Use a character/group name to bind preset to a specific chat.` + '</h4>';
4966 const name = await callPopup(popupText, 'input', oai_settings.preset_settings_openai);
49674964
4968 if (!name) {4965 if (!name) {
4969 return;4966 return;
@@ -5348,7 +5345,7 @@ async function onCustomizeParametersClick() {
5348 saveSettingsDebounced();5345 saveSettingsDebounced();
5349 });5346 });
53505347
5351 callPopup(template, 'text', '', { wide: true, large: true });5348 await callGenericPopup(template, POPUP_TYPE.TEXT, '', { wide: true, large: true });
5352}5349}
53535350
5354/**5351/**