added a reset button for the aggtags prompt. see #183
This commit is contained in:
parent
76aaa87bef
commit
e614b6732b
4 changed files with 20 additions and 3 deletions
|
|
@ -818,5 +818,9 @@
|
|||
"addtags_info_limit_num": {
|
||||
"message": "This statement will be added at the end of the prompt:",
|
||||
"description": ""
|
||||
},
|
||||
"reset_default": {
|
||||
"message": "Reset to default",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,8 @@
|
|||
|
||||
.btn_div{
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#addtags_info_limit_num{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<ul class="autocomplete-list hidden"></ul>
|
||||
</div>
|
||||
<div id="addtags_info_limit_num"></div>
|
||||
<div class="btn_div"><button id="btn_save_prompt" disabled>__MSG_save__</button></div>
|
||||
<div class="btn_div"><button id="btn_reset_prompt" disabled>__MSG_reset_default__</button><button id="btn_save_prompt" disabled>__MSG_save__</button></div>
|
||||
</div>
|
||||
<div id="addtags_excl_list_container">
|
||||
__MSG_AddTags_excl_list_title__
|
||||
|
|
|
|||
|
|
@ -24,9 +24,21 @@ let autocompleteSuggestions = [];
|
|||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
|
||||
let addtags_textarea = document.getElementById('addtags_prompt_text');
|
||||
let addtags_reset_btn = document.getElementById('btn_reset_prompt');
|
||||
|
||||
addtags_textarea.addEventListener('input', (event) => {
|
||||
addtags_reset_btn.disabled = (event.target.value === browser.i18n.getMessage('prompt_add_tags_full_text'));
|
||||
});
|
||||
|
||||
addtags_reset_btn.addEventListener('click', () => {
|
||||
addtags_textarea.value = browser.i18n.getMessage('prompt_add_tags_full_text');
|
||||
addtags_reset_btn.disabled = true;
|
||||
});
|
||||
|
||||
|
||||
let specialPrompts = await getSpecialPrompts();
|
||||
let addtags_prompt = specialPrompts.find(prompt => prompt.id === 'prompt_add_tags');
|
||||
let addtags_textarea = document.getElementById('addtags_prompt_text');
|
||||
addtags_prompt.text = browser.i18n.getMessage(addtags_prompt.text);
|
||||
addtags_textarea.value = addtags_prompt.text;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue