openai.js: update for new popup

55b3016985398286e3dfd43674998910ef16896a

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

1 files changed, +6 -9Ignore whitespace
public/scripts/openai.js+6 -9
@@ -71,7 +71,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
7171import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
7272import { renderTemplateAsync } from './templates.js';
7373import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';
7474import { callGenericPopup, Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';
7575import { t } from './i18n.js';
7676import { ToolManager } from './tool-calling.js';
7777import { accountStorage } from './util/AccountStorage.js';
@@ -4084,7 +4084,7 @@ async function onPresetImportFileChange(e) {
40844084 }
40854085
40864086 if (name in openai_setting_names) {
40874087 const confirm = await callPopupcallGenericPopup('Preset name already exists. Overwrite?', 'confirm'POPUP_TYPE.CONFIRM);
40884088
40894089 if (!confirm) {
40904090 return;
@@ -4220,7 +4220,7 @@ function onLogitBiasPresetExportClick() {
42204220}
42214221
42224222async function onDeletePresetClick() {
42234223 const confirm = await callPopupcallGenericPopup(t`Delete the preset? This action is irreversible and your current settings will be overwritten.`, 'confirm'POPUP_TYPE.CONFIRM);
42244224
42254225 if (!confirm) {
42264226 return;
@@ -4255,7 +4255,7 @@ async function onDeletePresetClick() {
42554255}
42564256
42574257async function onLogitBiasPresetDeleteClick() {
42584258 const value = await callPopupcallGenericPopup(t`Delete the preset?`, 'confirm'POPUP_TYPE.CONFIRM);
42594259
42604260 if (!value) {
42614261 return;
@@ -4960,10 +4960,7 @@ async function onOpenrouterModelSortChange() {
49604960}
49614961
49624962async 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
49684965 if (!name) {
49694966 return;
@@ -5348,7 +5345,7 @@ async function onCustomizeParametersClick() {
53485345 saveSettingsDebounced();
53495346 });
53505347
53515348 callPopupawait callGenericPopup(template, 'text'POPUP_TYPE.TEXT, '', { wide: true, large: true });
53525349}
53535350
53545351/**