openai.js: update for new popup
| @@ -71,7 +71,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js'; | ||
| 71 | 71 | import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js'; |
| 72 | 72 | import { renderTemplateAsync } from './templates.js'; |
| 73 | 73 | import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js'; |
| 74 | 74 | import { callGenericPopup, Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js'; |
| 75 | 75 | import { t } from './i18n.js'; |
| 76 | 76 | import { ToolManager } from './tool-calling.js'; |
| 77 | 77 | import { accountStorage } from './util/AccountStorage.js'; |
| @@ -4084,7 +4084,7 @@ async function onPresetImportFileChange(e) { | ||
| 4084 | 4084 | } |
| 4085 | 4085 | |
| 4086 | 4086 | if (name in openai_setting_names) { |
| 4087 | 4087 | const confirm = await callPopupcallGenericPopup('Preset name already exists. Overwrite?', 'confirm'POPUP_TYPE.CONFIRM); |
| 4088 | 4088 | |
| 4089 | 4089 | if (!confirm) { |
| 4090 | 4090 | return; |
| @@ -4220,7 +4220,7 @@ function onLogitBiasPresetExportClick() { | ||
| 4220 | 4220 | } |
| 4221 | 4221 | |
| 4222 | 4222 | async function onDeletePresetClick() { |
| 4223 | 4223 | const confirm = await callPopupcallGenericPopup(t`Delete the preset? This action is irreversible and your current settings will be overwritten.`, 'confirm'POPUP_TYPE.CONFIRM); |
| 4224 | 4224 | |
| 4225 | 4225 | if (!confirm) { |
| 4226 | 4226 | return; |
| @@ -4255,7 +4255,7 @@ async function onDeletePresetClick() { | ||
| 4255 | 4255 | } |
| 4256 | 4256 | |
| 4257 | 4257 | async function onLogitBiasPresetDeleteClick() { |
| 4258 | 4258 | const value = await callPopupcallGenericPopup(t`Delete the preset?`, 'confirm'POPUP_TYPE.CONFIRM); |
| 4259 | 4259 | |
| 4260 | 4260 | if (!value) { |
| 4261 | 4261 | return; |
| @@ -4960,10 +4960,7 @@ async function onOpenrouterModelSortChange() { | ||
| 4960 | 4960 | } |
| 4961 | 4961 | |
| 4962 | 4962 | async 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); | |
| 4967 | 4964 | |
| 4968 | 4965 | if (!name) { |
| 4969 | 4966 | return; |
| @@ -5348,7 +5345,7 @@ async function onCustomizeParametersClick() { | ||
| 5348 | 5345 | saveSettingsDebounced(); |
| 5349 | 5346 | }); |
| 5350 | 5347 | |
| 5351 | 5348 | callPopupawait callGenericPopup(template, 'text'POPUP_TYPE.TEXT, '', { wide: true, large: true }); |
| 5352 | 5349 | } |
| 5353 | 5350 | |
| 5354 | 5351 | /** |