// /c/: one check, polled until it is done. No ads inside the report body. (function () { 'use strict'; var id = location.pathname.split('/')[2], live = WWI.$('live'), t = null; function poll() { fetch('/api/check/' + id).then(function (r) { return r.json(); }).then(function (v) { if (!v.id) { live.innerHTML = '
' + WWI.esc(v.error || 'Not found') + '
'; return; } Render.draw(live, v); live.querySelectorAll('[data-deep]').forEach(function (b) { b.addEventListener('click', function () { location.href = '/?c=' + id + '#reports'; }); }); if (v.status === 'queued' || v.status === 'running') t = setTimeout(poll, 2500); }).catch(function () { t = setTimeout(poll, 5000); }); } poll(); })();