Spaces:
Running
Running
ruled-progress bar
Browse files- review.html +15 -0
review.html
CHANGED
|
@@ -55,6 +55,11 @@ footer .sp { flex: 1; }
|
|
| 55 |
style="font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;max-width:190px">
|
| 56 |
<button onclick="theme()" title="toggle theme">◐</button>
|
| 57 |
</header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
<main>
|
| 59 |
<div class="meta"><span id="key"></span><span id="surface"></span></div>
|
| 60 |
<div id="passage"></div>
|
|
@@ -198,6 +203,8 @@ function render() {
|
|
| 198 |
p = b;
|
| 199 |
}
|
| 200 |
pts.push(esc(o.text.slice(p, hi)));
|
|
|
|
|
|
|
| 201 |
plo = lo; phi = hi;
|
| 202 |
$('passage').innerHTML = pts.join('');
|
| 203 |
bindMarks(o);
|
|
@@ -228,6 +235,14 @@ function lightMeta() {
|
|
| 228 |
$('bDrop').className = 'drop' + (mine === 'NON_MENTION' ? ' on' : '');
|
| 229 |
$('mine').textContent = mine ? `your ruling: ${mine === 'DATA_MENTION' ? 'keep' : 'drop'}` : '';
|
| 230 |
$('count').textContent = Object.keys(R).length + ' ruled' + (lastSaved ? ' · last save: ' + lastSaved : '');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
}
|
| 232 |
function bindMarks(o) {
|
| 233 |
document.querySelectorAll('#passage mark').forEach(m => m.onclick = () => {
|
|
|
|
| 55 |
style="font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;max-width:190px">
|
| 56 |
<button onclick="theme()" title="toggle theme">◐</button>
|
| 57 |
</header>
|
| 58 |
+
<div style="display:flex;align-items:center;gap:10px;padding:6px 16px;background:var(--card);border-bottom:1px solid var(--line);font-size:13px;color:var(--mut)">
|
| 59 |
+
<span id="ruledLab" style="white-space:nowrap">0 ruled</span>
|
| 60 |
+
<div style="flex:1;height:6px;background:var(--chip);border-radius:3px;overflow:hidden"><div id="ruledFill" style="height:100%;width:0;background:var(--keep)"></div></div>
|
| 61 |
+
<span id="ruledPct"></span>
|
| 62 |
+
</div>
|
| 63 |
<main>
|
| 64 |
<div class="meta"><span id="key"></span><span id="surface"></span></div>
|
| 65 |
<div id="passage"></div>
|
|
|
|
| 203 |
p = b;
|
| 204 |
}
|
| 205 |
pts.push(esc(o.text.slice(p, hi)));
|
| 206 |
+
if (hi < L) pts.push('<span style="color:var(--mut)">…</span>');
|
| 207 |
+
pts.push(`<div style="color:var(--mut);font-size:12px;margin-top:8px">window ${lo}–${hi} of ${L} · ${wlabel()} · <kbd>[</kbd><kbd>]</kbd> slide · <kbd>-</kbd><kbd>+</kbd> size</div>`);
|
| 208 |
plo = lo; phi = hi;
|
| 209 |
$('passage').innerHTML = pts.join('');
|
| 210 |
bindMarks(o);
|
|
|
|
| 235 |
$('bDrop').className = 'drop' + (mine === 'NON_MENTION' ? ' on' : '');
|
| 236 |
$('mine').textContent = mine ? `your ruling: ${mine === 'DATA_MENTION' ? 'keep' : 'drop'}` : '';
|
| 237 |
$('count').textContent = Object.keys(R).length + ' ruled' + (lastSaved ? ' · last save: ' + lastSaved : '');
|
| 238 |
+
paintRuled();
|
| 239 |
+
}
|
| 240 |
+
function paintRuled() {
|
| 241 |
+
let tot = 0, done = 0;
|
| 242 |
+
for (const o of ITEMS) for (const x of o.spans) { tot++; if (R[x.key]) done++; }
|
| 243 |
+
$('ruledFill').style.width = (tot ? 100 * done / tot : 0) + '%';
|
| 244 |
+
$('ruledLab').textContent = `${done}/${tot} mentions ruled`;
|
| 245 |
+
$('ruledPct').textContent = tot ? Math.round(100 * done / tot) + '%' : '';
|
| 246 |
}
|
| 247 |
function bindMarks(o) {
|
| 248 |
document.querySelectorAll('#passage mark').forEach(m => m.onclick = () => {
|