|
4 | 4 | <meta charset="utf-8"> |
5 | 5 | <title>CDX Summary Tester</title> |
6 | 6 | <style> |
| 7 | + :root { |
| 8 | + --cdxsummary-thumb-scale: 0.3; |
| 9 | + } |
7 | 10 | body { |
8 | 11 | margin: 0; |
9 | 12 | } |
|
46 | 49 | <script type="module" src="cdxsummary.js"></script> |
47 | 50 | <script> |
48 | 51 | const lists = { |
49 | | - "attr": ["src", "item", "name", "report", "playback", "type", "format", "thumbs", "drawer"], |
| 52 | + "attr": ["src", "item", "name", "report", "playback", "type", "format", "thumbs", "fold"], |
50 | 53 | "src": ["samples/MC.summary.json", "samples/EoT20.summary.json"], |
51 | 54 | "item": ["mediacloud", "EndOfTerm2020WebCrawls", "epa-via-sitemap"], |
52 | 55 | "type": ["CDX", "collection", "item"], |
53 | 56 | "format": ["short", "percent", "local"] |
54 | 57 | }; |
55 | 58 | const l = Math.max(...(lists["attr"].map(el => el.length))); |
56 | 59 | const q = new URLSearchParams(location.search); |
57 | | - const g = a => q.get(a) || ''; |
| 60 | + const g = a => q.getAll(a).join(' '); |
58 | 61 | const f = a => `<br> ${a}${' '.repeat(l+1-a.length)}= "`; |
59 | 62 | const d = a => `<datalist id="${a}-list">${lists[a].map(i => `<option value="${i}">`).join('')}</datalist>`; |
60 | 63 | const elm = `<cdx-summary ${lists["attr"].filter(a => q.has(a)).map(i => `${i}="${g(i)}"`).join(' ')}></cdx-summary>`; |
|
73 | 76 | ${f('format')}<input name="format" value="${g('format')}" placeholder="Default: local" list="format-list" class="narrow-input">" |
74 | 77 | ${d('format')} |
75 | 78 | ${f('thumbs')}<input name="thumbs" value="${g('thumbs')}" type="number" min="0" placeholder="Thumbnail count" class="narrow-input">" |
76 | | - ${f('drawer')}<input name="drawer" value="open" type="checkbox" id="drawer"${g('drawer')=='open' ? ' checked' : ''}> |
77 | | - <label for="drawer">open</label>" |
| 79 | + ${f('fold')}<input name="fold" value="thumbs" type="checkbox" id="fold-thumbs"${g('fold').includes('thumbs') ? ' checked' : ''}> |
| 80 | + <label for="fold-thumbs">thumbs</label> |
| 81 | + <input name="fold" value="samples" type="checkbox" id="fold-samples"${g('fold').includes('samples') ? ' checked' : ''}> |
| 82 | + <label for="fold-samples">samples</label> |
| 83 | + <input name="fold" value="description" type="checkbox" id="fold-description"${g('fold').includes('description') ? ' checked' : ''}> |
| 84 | + <label for="fold-description">description</label>" |
78 | 85 | <br> |
79 | 86 | ></cdx-summary> |
80 | 87 | <input type="submit" value="Render" class="submit"> |
|
0 commit comments