added a button in the options page to open the tag info page. see #183
This commit is contained in:
parent
f4a7c97098
commit
fccd707677
3 changed files with 19 additions and 1 deletions
|
|
@ -170,6 +170,10 @@ input.option-input[type="text"]{
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn_small{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: rgb(35, 34, 43);
|
||||
|
|
|
|||
|
|
@ -267,7 +267,8 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr class="add_tags_tr">
|
||||
<td><span>__MSG_prefs_OptionText_add_tags__</span></td>
|
||||
<td><span>__MSG_prefs_OptionText_add_tags__</span>
|
||||
<br><button id="btnManageTagsInfo" class="btn_small">__MSG_prefs_OptionText_btnManageTagsInfo__</button></td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" id="add_tags" name="add_tags" class="option-input" />
|
||||
|
|
|
|||
|
|
@ -264,6 +264,19 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
})
|
||||
});
|
||||
|
||||
document.getElementById('btnManageTagsInfo').addEventListener('click', () => {
|
||||
// check if the tab is already there
|
||||
browser.tabs.query({url: browser.runtime.getURL('../addtags/mzta-add-tags.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('../addtags/mzta-add-tags.html')});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
let conntype_select = document.getElementById("connection_type");
|
||||
conntype_select.addEventListener("change", showConnectionOptions);
|
||||
conntype_select.addEventListener("change", warn_ChatGPT_APIKeyEmpty);
|
||||
|
|
|
|||
Loading…
Reference in a new issue