Enhance ChatGPT Web model selection by adding event listeners for new model inputs and updating HTML structure for better integration in custom prompts
This commit is contained in:
parent
eb804860b9
commit
a81b9daa54
1 changed files with 18 additions and 1 deletions
|
|
@ -347,8 +347,25 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
getChatGPTWebModelsList_HTML(ChatGPTWeb_models, 'chatgpt_web_models_list');
|
getChatGPTWebModelsList_HTML(ChatGPTWeb_models, 'chatgpt_web_models_list');
|
||||||
|
let formNewWebModelList = document.getElementById('chatgpt_web_models_list');
|
||||||
|
formNewWebModelList.querySelectorAll('.conntype_chatgpt_web_option').forEach(element => {
|
||||||
|
element.addEventListener("click", () => {
|
||||||
|
let el = document.getElementById("chatGPTWebModelNew");
|
||||||
|
el.value = element.textContent;
|
||||||
|
el.dispatchEvent(new Event('change'), { bubbles: true });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
document.querySelectorAll('.id_output').forEach(element => {
|
document.querySelectorAll('.id_output').forEach(element => {
|
||||||
getChatGPTWebModelsList_HTML(ChatGPTWeb_models, 'chatgpt_web_models_list_' + element.value);
|
getChatGPTWebModelsList_HTML(ChatGPTWeb_models, 'chatgpt_web_models_list_' + element.value);
|
||||||
|
let formWebModelList = document.getElementById('chatgpt_web_models_list_' + element.value);
|
||||||
|
formWebModelList.querySelectorAll('.conntype_chatgpt_web_option').forEach(element2 => {
|
||||||
|
element2.addEventListener("click", () => {
|
||||||
|
let el = document.getElementById("chatgpt_web_model_output_" + element.value);
|
||||||
|
el.value = element2.textContent;
|
||||||
|
el.dispatchEvent(new Event('change'), { bubbles: true });
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
|
|
@ -636,7 +653,7 @@ function loadPromptsList(values){
|
||||||
<div class="chatgpt_web_additional_info">
|
<div class="chatgpt_web_additional_info">
|
||||||
<span class="field_title_us">__MSG_prefs_OptionText_chatgpt_web_model__:</span>
|
<span class="field_title_us">__MSG_prefs_OptionText_chatgpt_web_model__:</span>
|
||||||
<br>
|
<br>
|
||||||
<input type="text" class="input_additional chatgpt_web_model_output" tabindex="10" value="` + values.chatgpt_web_model + `">
|
<input type="text" id="chatgpt_web_model_output_` + values.id + `" class="input_additional chatgpt_web_model_output" tabindex="10" value="` + values.chatgpt_web_model + `">
|
||||||
<table class="chatgpt_web_models_list_table" title="__MSG_prefs_OptionText_chatgpt_web_model_tooltip__"><tr id="chatgpt_web_models_list_` + values.id + `"></tr></table>
|
<table class="chatgpt_web_models_list_table" title="__MSG_prefs_OptionText_chatgpt_web_model_tooltip__"><tr id="chatgpt_web_models_list_` + values.id + `"></tr></table>
|
||||||
<br><br>
|
<br><br>
|
||||||
<span class="field_title_us">__MSG_prefs_OptionText_chatgpt_web_project__:</span>
|
<span class="field_title_us">__MSG_prefs_OptionText_chatgpt_web_project__:</span>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue