mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Update favicon with badge state on embed.html
.ico files were created with, convert -density 256x256 -background transparent toolbar-on.svg -define icon:auto-resize -colors 256 toolbar-on.ico Trac: 31537
This commit is contained in:
parent
5732f1a630
commit
faf02d86a1
5 changed files with 10 additions and 0 deletions
|
@ -31,6 +31,7 @@ class BadgeUI extends UI {
|
|||
this.popup.setEnabled(false);
|
||||
this.popup.setActive(false);
|
||||
this.popup.setStatusText(messages.getMessage('popupStatusOff'));
|
||||
this.setIcon('off');
|
||||
this.popup.setStatusDesc(missing, true);
|
||||
this.popup.hideButton();
|
||||
}
|
||||
|
@ -40,8 +41,10 @@ class BadgeUI extends UI {
|
|||
this.popup.setChecked(true);
|
||||
if (clients > 0) {
|
||||
this.popup.setStatusText(messages.getMessage('popupStatusOn', String(clients)));
|
||||
this.setIcon('running');
|
||||
} else {
|
||||
this.popup.setStatusText(messages.getMessage('popupStatusReady'));
|
||||
this.setIcon('on');
|
||||
}
|
||||
// FIXME: Share stats from webext
|
||||
this.popup.setStatusDesc('');
|
||||
|
@ -52,6 +55,7 @@ class BadgeUI extends UI {
|
|||
turnOff() {
|
||||
this.popup.setChecked(false);
|
||||
this.popup.setStatusText(messages.getMessage('popupStatusOff'));
|
||||
this.setIcon('off');
|
||||
this.popup.setStatusDesc('');
|
||||
this.popup.setEnabled(false);
|
||||
this.popup.setActive(false);
|
||||
|
@ -62,6 +66,10 @@ class BadgeUI extends UI {
|
|||
this.turnOn();
|
||||
}
|
||||
|
||||
setIcon(status) {
|
||||
document.getElementById('icon').href = `assets/toolbar-${status}.ico`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BadgeUI.prototype.popup = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue