mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Control statusimg using CSS, rather than setting an img src.
This commit is contained in:
parent
8f885c7557
commit
990047b2f5
5 changed files with 29 additions and 9 deletions
|
@ -14,7 +14,8 @@ class BadgeUI extends UI {
|
|||
setStatus() {}
|
||||
|
||||
missingFeature(missing) {
|
||||
this.popup.setImgSrc('off');
|
||||
this.popup.setEnabled(false);
|
||||
this.popup.setActive(false);
|
||||
this.popup.setStatusText("Snowflake is off");
|
||||
this.popup.setStatusDesc(missing, true);
|
||||
this.popup.hideButton();
|
||||
|
@ -28,7 +29,8 @@ class BadgeUI extends UI {
|
|||
// FIXME: Share stats from webext
|
||||
const total = 0;
|
||||
this.popup.setStatusDesc(`Your snowflake has helped ${total} user${(total !== 1) ? 's' : ''} circumvent censorship in the last 24 hours.`);
|
||||
this.popup.setImgSrc(this.active ? "running" : "on");
|
||||
this.popup.setEnabled(true);
|
||||
this.popup.setActive(this.active);
|
||||
}
|
||||
|
||||
turnOff() {
|
||||
|
@ -36,7 +38,8 @@ class BadgeUI extends UI {
|
|||
this.popup.setToggleText('Turn On');
|
||||
this.popup.setStatusText("Snowflake is off");
|
||||
this.popup.setStatusDesc("");
|
||||
this.popup.setImgSrc("off");
|
||||
this.popup.setEnabled(false);
|
||||
this.popup.setActive(false);
|
||||
}
|
||||
|
||||
setActive(connected) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue