mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
29 lines
795 B
JavaScript
29 lines
795 B
JavaScript
/* exported Popup */
|
|
|
|
class Popup {
|
|
constructor() {
|
|
this.div = document.getElementById('active');
|
|
this.statustext = document.getElementById('statustext');
|
|
this.statusdesc = document.getElementById('statusdesc');
|
|
this.img = document.getElementById('statusimg');
|
|
}
|
|
setImgSrc(src) {
|
|
this.img.src = `assets/status-${src}.png`;
|
|
}
|
|
setStatusText(txt) {
|
|
this.statustext.innerText = txt;
|
|
}
|
|
setStatusDesc(desc, color) {
|
|
this.statusdesc.innerText = desc;
|
|
this.statusdesc.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;
|
|
}
|
|
}
|