diff --git a/proxy/init-badge.js b/proxy/init-badge.js index 7684e68..fe8cc91 100644 --- a/proxy/init-badge.js +++ b/proxy/init-badge.js @@ -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; diff --git a/proxy/static/assets/toolbar-off.ico b/proxy/static/assets/toolbar-off.ico new file mode 100644 index 0000000..9483fc9 Binary files /dev/null and b/proxy/static/assets/toolbar-off.ico differ diff --git a/proxy/static/assets/toolbar-on.ico b/proxy/static/assets/toolbar-on.ico new file mode 100644 index 0000000..01203d5 Binary files /dev/null and b/proxy/static/assets/toolbar-on.ico differ diff --git a/proxy/static/assets/toolbar-running.ico b/proxy/static/assets/toolbar-running.ico new file mode 100644 index 0000000..1abf83e Binary files /dev/null and b/proxy/static/assets/toolbar-running.ico differ diff --git a/proxy/static/embed.html b/proxy/static/embed.html index 96bf90c..b3ca800 100644 --- a/proxy/static/embed.html +++ b/proxy/static/embed.html @@ -4,6 +4,8 @@ + Snowflake +