The Circle — anyone taking this course
'); w.document.close(); w.print(); } }); act.appendChild(dl); sh.appendChild(act); ov.hidden=false; }); document.getElementById('certOv').addEventListener('click', function(e){ if(e.target.id==='certOv') e.target.hidden=true; }); /* ── the circle (local, per-browser; a real backend is the next build) ── */ var K_CIRCLE='hon-course-circle-notes'; function circleNotes(){ try{ return JSON.parse(localStorage.getItem(K_CIRCLE)||'[]'); }catch(e){ return []; } } function saveCircle(list){ try{ localStorage.setItem(K_CIRCLE, JSON.stringify(list)); }catch(e){} } document.getElementById('openCircle').addEventListener('click', function(){ open(function(b){ b.appendChild(el('p','kk','The circle')); b.appendChild(el('h2',null,'Everyone taking this, in one place')); b.appendChild(el('p','dk','This runs locally for now — a note you leave here stays on this machine until the circle has a real server behind it. Say what module you\'re on and what is alive in it.')); var list = circleNotes(); var wrap = el('div','circ-list'); if (!list.length) wrap.appendChild(el('p','circ-empty','Nobody has left a note here yet. Be the first.')); list.slice().reverse().forEach(function(n){ var r = el('div','circ-row'); var who = el('div'); who.appendChild(document.createTextNode(n.name||'Anonymous')); who.appendChild(el('span','mod', C.modules[n.mod] ? ('Module '+C.modules[n.mod].num) : '')); r.appendChild(who); r.appendChild(el('p','note', n.text)); wrap.appendChild(r); }); b.appendChild(wrap); var sig = el('div','circ-signal'); sig.appendChild(el('span','lb','Beyond this browser')); var sigA = document.createElement('a'); sigA.href = 'https://signal.me/#eu/haute-lumiere-ti'; sigA.target = '_blank'; sigA.rel = 'noopener'; sigA.textContent = 'Join the circle on Signal'; sig.appendChild(sigA); b.appendChild(sig); var form = el('div','circ-form'); var nm = document.createElement('input'); nm.className='cert-name-in'; nm.style.width='100%'; nm.placeholder='Your name (optional)'; var savedName=''; try{ savedName=localStorage.getItem(K_NAME)||''; }catch(e){} if (savedName) nm.value = savedName; form.appendChild(nm); var ta = document.createElement('textarea'); ta.placeholder = 'What is alive for you right now, module '+(C.modules[cur]?C.modules[cur].num:'—')+'?'; form.appendChild(ta); var post = el('button',null,'Leave it for the circle'); post.addEventListener('click', function(){ var t=(ta.value||'').trim(); if(!t) return; var list2 = circleNotes(); list2.push({ name:(nm.value||'').trim()||'Anonymous', mod:cur, text:t, at:Date.now() }); saveCircle(list2); shut(); document.getElementById('openCircle').click(); }); form.appendChild(post); b.appendChild(form); }); }); document.getElementById('condToggle').addEventListener('click', function(){ condensed = !condensed; try{ localStorage.setItem(K_COND, condensed ? '1' : '0'); }catch(e){} rail(); }); rail(); go(cur); paintLock(); })();