Spaces:
Running
Running
optional freeform note per ruling
Browse files101 unmodified lines10210310410510610740 unmodified lines14814915015115215317 unmodified lines17117217317417517656 unmodified lines233234235236237238112 unmodified lines35135235335435535627 unmodified lines38438538638738838939057 unmodified lines44844945045145245320 unmodified lines474475476477478479480481482483484101 unmodified lines<button class="drop" id="bDrop" onclick="rule('NON_MENTION')">drop <kbd>d</kbd></button><button class="nav" onclick="move(1)">next →</button></div><div id="mine"></div><footer><span><kbd>←</kbd><kbd>→</kbd> prev/next mention · <kbd>k</kbd> keep · <kbd>d</kbd> drop · <kbd>space</kbd> skip · <kbd>[</kbd><kbd>]</kbd> slide · <kbd>-</kbd><kbd>+</kbd> size · <kbd>e</kbd> export</span>40 unmodified linesconst LS = 'review_rulings';let R = JSON.parse(localStorage.getItem(LS) || '{}');let RQ = JSON.parse(localStorage.getItem('review_queues') || '{}');const $ = id => document.getElementById(id);const esc = s => String(s).replace(/[&<>]/g, c => ({'&':'&','<':'<','>':'>'}[c]));const QD = document.documentElement;17 unmodified linesconst w = who().toLowerCase();if (USERS.includes(w) && $('ds').value !== w) { $('ds').value = w; loadDs(); }});const ht = $('hubtok');if (ht) { ht.value = localStorage.getItem('review_hubtok') || ''; ht.addEventListener('input', () => localStorage.setItem('review_hubtok', ht.value.trim())); }if (localStorage.getItem('review_locked') === '1' && who()) setLocked(true);56 unmodified linesdocument.querySelector('#bar > div').style.width = (100 * (i + 1) / ITEMS.length) + '%';$('key').textContent = sp.key;$('surface').textContent = '“' + sp.surface + '”';// sliding assessment window around the active spanif (needCenter || wc === null) { wc = (sp.start + sp.end) / 2; needCenter = false; }const W = WSIZES[wi], L = o.text.length;112 unmodified lines$('prog').textContent = `${i + 1}/${ITEMS.length} · span ${s + 1}/${o.spans.length}`;$('key').textContent = sp.key;$('surface').textContent = '“' + sp.surface + '”';document.querySelectorAll('#passage mark').forEach(m => {m.classList.toggle('active', m.dataset.k === sp.key);m.classList.toggle('done-k', R[m.dataset.k] === 'DATA_MENTION');27 unmodified lineslocalStorage.setItem('review_queues', JSON.stringify(RQ));setLocked(true);paintGate();const entry = {key: k, ruling: v, queue: $('ds').value, annotator: who()};let saved = 'this browser only';try {const r = await fetch('/api/rulings', {method: 'POST', headers: {'Content-Type': 'application/json'},57 unmodified linesconst rows = Object.entries(R).map(([key, ruling]) => {const hit = idx[key];const base = {key, ruling, queue: RQ[key] || $('ds').value, annotator: who(),ts: new Date().toISOString().replace(/\.\d+Z$/, '+00:00')};if (!hit) return base;const {o, x} = hit;20 unmodified linesif (!it.key || !['DATA_MENTION', 'NON_MENTION'].includes(it.ruling)) continue;R[it.key] = it.ruling;if (it.queue) RQ[it.key] = it.queue;n++;}}localStorage.setItem(LS, JSON.stringify(R));localStorage.setItem('review_queues', JSON.stringify(RQ));// jump to first unruled spanlet done = false;for (let ni = 0; ni < ITEMS.length && !done; ni++)101 unmodified lines10210310410510610710810940 unmodified lines15015115215315415515615717 unmodified lines17517617717817918018118218318418518656 unmodified lines243244245246247248249112 unmodified lines36236336436536636736827 unmodified lines39639739839940040140240340457 unmodified lines46246346446546646746820 unmodified lines489490491492493494495496497498499500501101 unmodified lines<button class="drop" id="bDrop" onclick="rule('NON_MENTION')">drop <kbd>d</kbd></button><button class="nav" onclick="move(1)">next →</button></div><input id="note" placeholder="note (optional, saved with your ruling)" autocomplete="off"style="width:100%;margin-top:10px;font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:8px 12px"><div id="mine"></div><footer><span><kbd>←</kbd><kbd>→</kbd> prev/next mention · <kbd>k</kbd> keep · <kbd>d</kbd> drop · <kbd>space</kbd> skip · <kbd>[</kbd><kbd>]</kbd> slide · <kbd>-</kbd><kbd>+</kbd> size · <kbd>e</kbd> export</span>40 unmodified linesconst LS = 'review_rulings';let R = JSON.parse(localStorage.getItem(LS) || '{}');let RQ = JSON.parse(localStorage.getItem('review_queues') || '{}');let RN = JSON.parse(localStorage.getItem('review_notes') || '{}');function saveNotes() { localStorage.setItem('review_notes', JSON.stringify(RN)); }const $ = id => document.getElementById(id);const esc = s => String(s).replace(/[&<>]/g, c => ({'&':'&','<':'<','>':'>'}[c]));const QD = document.documentElement;17 unmodified linesconst w = who().toLowerCase();if (USERS.includes(w) && $('ds').value !== w) { $('ds').value = w; loadDs(); }});$('note').addEventListener('input', () => {if (!ITEMS.length) return;const v = $('note').value;if (v) RN[span().key] = v; else delete RN[span().key];saveNotes();});const ht = $('hubtok');if (ht) { ht.value = localStorage.getItem('review_hubtok') || ''; ht.addEventListener('input', () => localStorage.setItem('review_hubtok', ht.value.trim())); }if (localStorage.getItem('review_locked') === '1' && who()) setLocked(true);56 unmodified linesdocument.querySelector('#bar > div').style.width = (100 * (i + 1) / ITEMS.length) + '%';$('key').textContent = sp.key;$('surface').textContent = '“' + sp.surface + '”';if (document.activeElement !== $('note')) $('note').value = RN[sp.key] || '';// sliding assessment window around the active spanif (needCenter || wc === null) { wc = (sp.start + sp.end) / 2; needCenter = false; }const W = WSIZES[wi], L = o.text.length;112 unmodified lines$('prog').textContent = `${i + 1}/${ITEMS.length} · span ${s + 1}/${o.spans.length}`;$('key').textContent = sp.key;$('surface').textContent = '“' + sp.surface + '”';if (document.activeElement !== $('note')) $('note').value = RN[sp.key] || '';document.querySelectorAll('#passage mark').forEach(m => {m.classList.toggle('active', m.dataset.k === sp.key);m.classList.toggle('done-k', R[m.dataset.k] === 'DATA_MENTION');27 unmodified lineslocalStorage.setItem('review_queues', JSON.stringify(RQ));setLocked(true);paintGate();const note = ($('note').value || '').trim();if (note) { RN[k] = note; saveNotes(); }const entry = {key: k, ruling: v, queue: $('ds').value, annotator: who(), note: note || undefined};let saved = 'this browser only';try {const r = await fetch('/api/rulings', {method: 'POST', headers: {'Content-Type': 'application/json'},57 unmodified linesconst rows = Object.entries(R).map(([key, ruling]) => {const hit = idx[key];const base = {key, ruling, queue: RQ[key] || $('ds').value, annotator: who(),note: RN[key] || undefined,ts: new Date().toISOString().replace(/\.\d+Z$/, '+00:00')};if (!hit) return base;const {o, x} = hit;20 unmodified linesif (!it.key || !['DATA_MENTION', 'NON_MENTION'].includes(it.ruling)) continue;R[it.key] = it.ruling;if (it.queue) RQ[it.key] = it.queue;if (it.note) RN[it.key] = it.note;n++;}}localStorage.setItem(LS, JSON.stringify(R));localStorage.setItem('review_queues', JSON.stringify(RQ));saveNotes();// jump to first unruled spanlet done = false;for (let ni = 0; ni < ITEMS.length && !done; ni++)
review.html+18-1