clicking on chatgpt_web_model allowed options now sets the text field

This commit is contained in:
mic 2024-10-28 23:01:37 +01:00
parent 3ec981da76
commit 361e512114
3 changed files with 10 additions and 1 deletions

View file

@ -166,6 +166,10 @@ input.option-input[type="text"]{
border-radius: 4px;
}
.conntype_chatgpt_web_option{
cursor: pointer;
}
@media (prefers-color-scheme: dark) {
body {
background-color: rgb(35, 34, 43);

View file

@ -116,7 +116,7 @@
<tr class="conntype_chatgpt_web">
<td><label>
<span>__MSG_prefs_OptionText_chatgpt_web_model__</span>
<br><table><tr><td><i style="font-size:smaller;"><nobr>__MSG_AllowedValues__:</nobr></i></td><td><i style="font-size:smaller;"> &nbsp; <nobr>gpt-4o</nobr> &nbsp; <nobr>gpt-4o-mini</nobr> &nbsp; <nobr>gpt-4</nobr> &nbsp; <nobr>o1-mini</nobr> &nbsp; <nobr>o1-preview</nobr></i></td></tr></table>
<br><table><tr><td><i style="font-size:smaller;"><nobr>__MSG_AllowedValues__:</nobr></i></td><td><i style="font-size:smaller;"> &nbsp; <nobr class="conntype_chatgpt_web_option">gpt-4o</nobr> &nbsp; <nobr class="conntype_chatgpt_web_option">gpt-4o-mini</nobr> &nbsp; <nobr class="conntype_chatgpt_web_option">gpt-4</nobr> &nbsp; <nobr class="conntype_chatgpt_web_option">o1-mini</nobr> &nbsp; <nobr class="conntype_chatgpt_web_option">o1-preview</nobr></i></td></tr></table>
</label></td>
<td>
<label>

View file

@ -226,6 +226,11 @@ document.addEventListener('DOMContentLoaded', async () => {
document.querySelectorAll(".option-input").forEach(element => {
element.addEventListener("change", saveOptions);
});
document.querySelectorAll(".conntype_chatgpt_web_option").forEach(element => {
element.addEventListener("click", () => {
document.getElementById("chatgpt_web_model").value = element.textContent;
});
});
document.getElementById('btnManagePrompts').addEventListener('click', () => {
// check if the tab is already there