diff --git a/pages/_lib/connection-ui.js b/pages/_lib/connection-ui.js
index f5d39800..550a1491 100644
--- a/pages/_lib/connection-ui.js
+++ b/pages/_lib/connection-ui.js
@@ -44,7 +44,9 @@ export async function injectConnectionUI({
no_chatgpt_web = false,
defaultType = '',
tr_class = '',
- taLog = console
+ taLog = console,
+ customButtonLabel = '',
+ customButtonCallback = null
} = {}) {
const anchorTr = document.getElementById(afterTrId);
@@ -74,8 +76,9 @@ export async function injectConnectionUI({
- |
@@ -961,6 +964,16 @@ export async function injectConnectionUI({
warn_Anthropic_APIKeyEmpty(modelId_prefix);
warn_Anthropic_VersionEmpty(modelId_prefix);
+ if (customButtonLabel && customButtonCallback) {
+ const btn = document.getElementById(`${modelId_prefix}customButton`);
+ if (btn) {
+ btn.addEventListener('click', (e) => {
+ e.preventDefault();
+ customButtonCallback(e);
+ });
+ }
+ }
+
return {
select: conntype_select,
onTypeChange: (fn) => { onTypeChange = fn; fn(conntype_select.value, { select: conntype_select }); }
diff --git a/pages/customprompts/mzta-custom-prompts.js b/pages/customprompts/mzta-custom-prompts.js
index 8753c018..70308dfa 100644
--- a/pages/customprompts/mzta-custom-prompts.js
+++ b/pages/customprompts/mzta-custom-prompts.js
@@ -489,7 +489,15 @@ function handleEditClick(e) {
selectId: selectId,
modelId_prefix: prefix,
no_chatgpt_web: true,
- taLog: taLog
+ taLog: taLog,
+ customButtonLabel: "Reset",
+ customButtonCallback: () => {
+ const selectEl = document.getElementById(selectId);
+ if (selectEl) {
+ selectEl.value = '';
+ selectEl.dispatchEvent(new Event('change'));
+ }
+ }
}).then(() => {
populateConnectionUI(tr, id, prefix, selectId);
updateWarnings(prefix);