use texts.symbols to modify the extension icon
This commit is contained in:
parent
007435683d
commit
2e9ddc7f0c
1 changed files with 3 additions and 15 deletions
|
@ -1,34 +1,22 @@
|
|||
import BrowserIcon from '/scripts/GUI/extensionIcon.js';
|
||||
import Image from '/scripts/mapping/image.js';
|
||||
import Tabs from '/scripts/GUI/tabs.js';
|
||||
import texts from "/scripts/mapping/read.js";
|
||||
import {session} from '/scripts/secretariat.js';
|
||||
|
||||
class IconIndicator {
|
||||
/*
|
||||
Update the icon.
|
||||
|
||||
@param {string} state The state to update the icon to.
|
||||
*/
|
||||
static update(state = false) {
|
||||
(Image.get(((state) ? `default` : 'disabled'))).then((ICON) => {
|
||||
(Tabs.query(null, 0)).then((DATA) => {
|
||||
BrowserIcon.set({"Icon": ICON});
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
Indicate that the website is supported through icon change.
|
||||
*/
|
||||
static async enable() {
|
||||
IconIndicator.update(true);
|
||||
BrowserIcon.set({"BadgeText": await (new texts(`extensionIcon_website_loading`)).symbol});
|
||||
}
|
||||
|
||||
/*
|
||||
Indicate that the website isn't supported through icon change.
|
||||
*/
|
||||
static async disable() {
|
||||
IconIndicator.update(false);
|
||||
BrowserIcon.set({"BadgeText": await (new texts(`extensionIcon_website_unsupported`)).symbol});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue