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