added a btn to open the manage prompts tab
This commit is contained in:
parent
2f3fd93095
commit
da955b4a26
4 changed files with 25 additions and 0 deletions
|
|
@ -164,6 +164,11 @@
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"prefs_OptionText_btnManagePrompts": {
|
||||||
|
"message": "Manage your prompts",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
|
||||||
"prefsInfoTitle": {
|
"prefsInfoTitle": {
|
||||||
"message": "Important Information",
|
"message": "Important Information",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,11 @@
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"prefs_OptionText_btnManagePrompts": {
|
||||||
|
"message": "Gestisci i tuoi prompts",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
|
||||||
"prefsInfoTitle": {
|
"prefsInfoTitle": {
|
||||||
"message": "Informazioni Importanti",
|
"message": "Informazioni Importanti",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,9 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<div id="btn_custom_prompts">
|
||||||
|
<button id="btnManagePrompts">__MSG_prefs_OptionText_btnManagePrompts__</button>
|
||||||
|
</div>
|
||||||
<div id="miczDescription">
|
<div id="miczDescription">
|
||||||
<h1>__MSG_prefsInfoTitle__</h1>
|
<h1>__MSG_prefsInfoTitle__</h1>
|
||||||
<p>__MSG_prefsInfoDesc_1__<br/>
|
<p>__MSG_prefsInfoDesc_1__<br/>
|
||||||
|
|
|
||||||
|
|
@ -93,4 +93,16 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
document.querySelectorAll(".option-input").forEach(element => {
|
document.querySelectorAll(".option-input").forEach(element => {
|
||||||
element.addEventListener("change", saveOptions);
|
element.addEventListener("change", saveOptions);
|
||||||
});
|
});
|
||||||
|
document.getElementById('btnManagePrompts').addEventListener('click', () => {
|
||||||
|
// check if the tab is already there
|
||||||
|
browser.tabs.query({url: browser.runtime.getURL('../customprompts/mzta-custom-prompts.html')}).then((tabs) => {
|
||||||
|
if (tabs.length > 0) {
|
||||||
|
// if the tab is already there, focus it
|
||||||
|
browser.tabs.update(tabs[0].id, {active: true});
|
||||||
|
} else {
|
||||||
|
// if the tab is not there, create it
|
||||||
|
browser.tabs.create({url: browser.runtime.getURL('../customprompts/mzta-custom-prompts.html')});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue