mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Reimagine the badge
Trac 27385
This commit is contained in:
parent
0bded511b9
commit
e60f22833a
29 changed files with 401 additions and 351 deletions
28
proxy/static/popup.js
Normal file
28
proxy/static/popup.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* exported Popup */
|
||||
|
||||
class Popup {
|
||||
constructor() {
|
||||
this.div = document.getElementById('active');
|
||||
this.ps = this.div.querySelectorAll('p');
|
||||
this.img = this.div.querySelector('img');
|
||||
}
|
||||
setImgSrc(src) {
|
||||
this.img.src = `icons/status-${src}.png`;
|
||||
}
|
||||
setStatusText(txt) {
|
||||
this.ps[0].innerText = txt;
|
||||
}
|
||||
setStatusDesc(desc, color) {
|
||||
this.ps[1].innerText = desc;
|
||||
this.ps[1].style.color = color || 'black';
|
||||
}
|
||||
hideButton() {
|
||||
document.querySelector('.button').style.display = 'none';
|
||||
}
|
||||
setChecked(checked) {
|
||||
document.getElementById('enabled').checked = checked;
|
||||
}
|
||||
setToggleText(txt) {
|
||||
document.getElementById('toggle').innerText = txt;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue