snowflake/proxy/static/popup.js
Arlo Breault b324d9d42f Move icons/ to assets/
There's a default alias for icons/ in apache,
https://www.electrictoolbox.com/apache-icons-directory/
2019-07-31 17:59:48 -04:00

28 lines
697 B
JavaScript

/* 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 = `assets/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;
}
}