INNER CODE UNIT · JavaScript
setCell
polius/FileSync · web/js/test-diagnostics.js:26
function setCell(id, ok, label, state) {
const el = document.getElementById(id);
if (!el) return;
let cls, text;
if (state) { cls = state; text = label || ''; }
else if (ok === true) { cls = 'ok'; text = label || 'Yes'; }
else if (ok === false) { cls = 'bad'; text = label || 'No'; }
else { cls = 'wait'; text = label || 'Checking…'; }
el.innerHTML = '';
const span = document.createElement('span');
span.className = 'pill ' + cls;
span.textContent = text;
el.appendChild(span);
}
function detectCapabilities() {
const secure = window.isSecureContext === true;
const webrtc = typeof RTCPeerConnection !== 'undefined';