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:
Arlo Breault 2019-10-01 16:45:04 -04:00
parent 5732f1a630
commit faf02d86a1
5 changed files with 10 additions and 0 deletions

View file

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

View file

@ -4,6 +4,8 @@
<meta charset="utf-8" />
<!-- This should be essentially be a no-opt in the popup -->
<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" />
<script src="popup.js"></script>
<script src="embed.js"></script>