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.setEnabled(false);
|
||||||
this.popup.setActive(false);
|
this.popup.setActive(false);
|
||||||
this.popup.setStatusText(messages.getMessage('popupStatusOff'));
|
this.popup.setStatusText(messages.getMessage('popupStatusOff'));
|
||||||
|
this.setIcon('off');
|
||||||
this.popup.setStatusDesc(missing, true);
|
this.popup.setStatusDesc(missing, true);
|
||||||
this.popup.hideButton();
|
this.popup.hideButton();
|
||||||
}
|
}
|
||||||
|
@ -40,8 +41,10 @@ class BadgeUI extends UI {
|
||||||
this.popup.setChecked(true);
|
this.popup.setChecked(true);
|
||||||
if (clients > 0) {
|
if (clients > 0) {
|
||||||
this.popup.setStatusText(messages.getMessage('popupStatusOn', String(clients)));
|
this.popup.setStatusText(messages.getMessage('popupStatusOn', String(clients)));
|
||||||
|
this.setIcon('running');
|
||||||
} else {
|
} else {
|
||||||
this.popup.setStatusText(messages.getMessage('popupStatusReady'));
|
this.popup.setStatusText(messages.getMessage('popupStatusReady'));
|
||||||
|
this.setIcon('on');
|
||||||
}
|
}
|
||||||
// FIXME: Share stats from webext
|
// FIXME: Share stats from webext
|
||||||
this.popup.setStatusDesc('');
|
this.popup.setStatusDesc('');
|
||||||
|
@ -52,6 +55,7 @@ class BadgeUI extends UI {
|
||||||
turnOff() {
|
turnOff() {
|
||||||
this.popup.setChecked(false);
|
this.popup.setChecked(false);
|
||||||
this.popup.setStatusText(messages.getMessage('popupStatusOff'));
|
this.popup.setStatusText(messages.getMessage('popupStatusOff'));
|
||||||
|
this.setIcon('off');
|
||||||
this.popup.setStatusDesc('');
|
this.popup.setStatusDesc('');
|
||||||
this.popup.setEnabled(false);
|
this.popup.setEnabled(false);
|
||||||
this.popup.setActive(false);
|
this.popup.setActive(false);
|
||||||
|
@ -62,6 +66,10 @@ class BadgeUI extends UI {
|
||||||
this.turnOn();
|
this.turnOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setIcon(status) {
|
||||||
|
document.getElementById('icon').href = `assets/toolbar-${status}.ico`;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BadgeUI.prototype.popup = null;
|
BadgeUI.prototype.popup = null;
|
||||||
|
|
BIN
proxy/static/assets/toolbar-off.ico
Normal file
BIN
proxy/static/assets/toolbar-off.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 379 KiB |
BIN
proxy/static/assets/toolbar-on.ico
Normal file
BIN
proxy/static/assets/toolbar-on.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 377 KiB |
BIN
proxy/static/assets/toolbar-running.ico
Normal file
BIN
proxy/static/assets/toolbar-running.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 377 KiB |
|
@ -4,6 +4,8 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<!-- This should be essentially be a no-opt in the popup -->
|
<!-- This should be essentially be a no-opt in the popup -->
|
||||||
<meta http-equiv="refresh" content="86400" />
|
<meta http-equiv="refresh" content="86400" />
|
||||||
|
<title>Snowflake</title>
|
||||||
|
<link rel="icon" id="icon" href="assets/toolbar-off.ico" />
|
||||||
<link rel="stylesheet" href="embed.css" />
|
<link rel="stylesheet" href="embed.css" />
|
||||||
<script src="popup.js"></script>
|
<script src="popup.js"></script>
|
||||||
<script src="embed.js"></script>
|
<script src="embed.js"></script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue