useless switch converted to if
This commit is contained in:
parent
a96e87e95a
commit
07f5c699a4
1 changed files with 22 additions and 25 deletions
|
|
@ -213,32 +213,29 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
});
|
});
|
||||||
showConnectionOptions(apiSelect);
|
showConnectionOptions(apiSelect);
|
||||||
|
|
||||||
switch(prefs.connection_type) {
|
if(prefs.connection_type == 'chatgpt_web') {
|
||||||
case 'chatgpt_web': {
|
// for the new item form
|
||||||
// for the new item form
|
document.getElementById('chatgpt_web_additional_info_toggle').style.display = 'table-row';
|
||||||
document.getElementById('chatgpt_web_additional_info_toggle').style.display = 'table-row';
|
// for the edit list items form
|
||||||
// for the edit list items form
|
document.querySelectorAll('.chatgpt_web_additional_info_toggle').forEach(element => {
|
||||||
document.querySelectorAll('.chatgpt_web_additional_info_toggle').forEach(element => {
|
element.addEventListener('click', (e) => {
|
||||||
element.addEventListener('click', (e) => {
|
e.preventDefault();
|
||||||
e.preventDefault();
|
let additionalInfoRow = e.target.closest('td').querySelector('.chatgpt_web_additional_info');
|
||||||
let additionalInfoRow = e.target.closest('td').querySelector('.chatgpt_web_additional_info');
|
if (additionalInfoRow.style.display === 'none' || additionalInfoRow.style.display === '') {
|
||||||
if (additionalInfoRow.style.display === 'none' || additionalInfoRow.style.display === '') {
|
additionalInfoRow.style.display = 'block';
|
||||||
additionalInfoRow.style.display = 'block';
|
e.target.innerText = browser.i18n.getMessage('customPrompts_hide_additional_info') + ' [ChatGPT Web]';
|
||||||
e.target.innerText = browser.i18n.getMessage('customPrompts_hide_additional_info') + ' [ChatGPT Web]';
|
} else {
|
||||||
} else {
|
additionalInfoRow.style.display = 'none';
|
||||||
additionalInfoRow.style.display = 'none';
|
e.target.innerText = browser.i18n.getMessage('customPrompts_show_additional_info') + ' [ChatGPT Web]';
|
||||||
e.target.innerText = browser.i18n.getMessage('customPrompts_show_additional_info') + ' [ChatGPT Web]';
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
document.querySelectorAll('input.chatgpt_web_project_output').forEach(element => {
|
});
|
||||||
element.addEventListener("input", validateCustomData_ChatGPTWeb);
|
document.querySelectorAll('input.chatgpt_web_project_output').forEach(element => {
|
||||||
});
|
element.addEventListener("input", validateCustomData_ChatGPTWeb);
|
||||||
document.querySelectorAll('input.chatgpt_web_custom_gpt_output').forEach(element => {
|
});
|
||||||
element.addEventListener("input", validateCustomData_ChatGPTWeb);
|
document.querySelectorAll('input.chatgpt_web_custom_gpt_output').forEach(element => {
|
||||||
});
|
element.addEventListener("input", validateCustomData_ChatGPTWeb);
|
||||||
break;
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for the edit list items form [API]
|
// for the edit list items form [API]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue