added the tag limit info text. see #183

This commit is contained in:
mic 2024-12-14 23:46:37 +01:00
parent d3365e0c8f
commit 49c4a33ef2
4 changed files with 16 additions and 1 deletions

View file

@ -814,5 +814,9 @@
"save": {
"message": "Save",
"description": ""
},
"addtags_info_limit_num": {
"message": "This statement will be added at the end of the prompt:",
"description": ""
}
}

View file

@ -36,4 +36,8 @@
.btn_div{
width: 100%;
text-align: right;
}
#addtags_info_limit_num{
display: none;
}

View file

@ -15,6 +15,7 @@
__MSG_AddTags_prompt_text_title__
<br><span class="infoline">__MSG_prefs_OptionText_btnManagePrompts_infoline__ <a href="https://micz.it/thunderbird-addon-thunderai/data-placeholders/">__MSG_customPrompts_managePrompts_help__</a></span>
<br><textarea id="addtags_prompt_text" rows="15"></textarea>
<div id="addtags_info_limit_num"></div>
<div class="btn_div"><button id="btn_save_prompt" disabled>__MSG_save__</button></div>
</div>
<div id="addtags_excl_list_container">

View file

@ -23,8 +23,14 @@ document.addEventListener('DOMContentLoaded', async () => {
let specialPrompts = await getSpecialPrompts();
let addtags_prompt = specialPrompts.find(prompt => prompt.id === 'prompt_add_tags');
addtags_prompt.text = browser.i18n.getMessage(addtags_prompt.text);
document.getElementById('addtags_prompt_text').value = addtags_prompt.text;
let prefs_maxt = await browser.storage.sync.get({add_tags_maxnum: 3});
if(prefs_maxt.add_tags_maxnum > 0){
let el_tag_limit = document.getElementById('addtags_info_limit_num');
el_tag_limit.textContent = browser.i18n.getMessage("addtags_info_limit_num") + " \"" + browser.i18n.getMessage("prompt_add_tags_maxnum") + " " + prefs_maxt.add_tags_maxnum +"\".";
el_tag_limit.style.display = 'block';
}
i18n.updateDocument();
});