add_tags_maxnum option added. see #183

This commit is contained in:
Mic 2024-12-13 00:23:00 +01:00
parent 45b26747fa
commit 99cab276fa
4 changed files with 29 additions and 3 deletions

View file

@ -766,5 +766,13 @@
"placeholder_full_tags_list": {
"message": "Existing tags",
"description": ""
},
"prefs_OptionText_add_tags_maxnum": {
"message": "Maximum number of tags",
"description": ""
},
"prefs_OptionText_add_tags_maxnum_Info": {
"message": "The maximum number of tags proposed by the AI.",
"description": ""
}
}

View file

@ -38,4 +38,5 @@ export const prefs_default = {
placeholders_use_default_value: false,
max_prompt_length: 30000, // max string length for prompt
add_tags: false,
add_tags_maxnum: 3,
}

View file

@ -266,7 +266,7 @@
</label>
</td>
</tr>
<tr id="add_tags_tr">
<tr class="add_tags_tr">
<td><span>__MSG_prefs_OptionText_add_tags__</span></td>
<td>
<label>
@ -275,6 +275,15 @@
</label>
</td>
</tr>
<tr class="add_tags_tr">
<td><span>__MSG_prefs_OptionText_add_tags_maxnum__</span></td>
<td>
<label>
<input type="number" id="add_tags_maxnum" name="add_tags_maxnum" class="option-input" />
<br>__MSG_prefs_OptionText_add_tags_maxnum_Info__
</label>
</td>
</tr>
<tr>
<td style="width:20em"><label>
<span>__MSG_Debug__</span>

View file

@ -215,10 +215,18 @@ function disable_MaxPromptLength(){
function disable_AddTags(){
let add_tags = document.getElementById('add_tags');
let add_tags_maxnum = document.getElementById('add_tags_maxnum');
let conntype_select = document.getElementById("connection_type");
add_tags.disabled = (conntype_select.value === "chatgpt_web");
let add_tags_tr = document.getElementById('add_tags_tr');
add_tags_tr.style.display = (add_tags.disabled) ? 'none' : 'table-row';
add_tags_maxnum.disabled = (conntype_select.value === "chatgpt_web");
// Seleziona tutti gli elementi con la classe 'add_tags_tr'
let add_tags_tr_elements = document.querySelectorAll('.add_tags_tr');
// Applica lo stile a tutti gli elementi con la classe
add_tags_tr_elements.forEach(add_tags_tr => {
add_tags_tr.style.display = (add_tags.disabled) ? 'none' : 'table-row';
});
}
document.addEventListener('DOMContentLoaded', async () => {