Skip to content

Commit 817ee06

Browse files
committed
Update tested with fold attribute
1 parent 3cef147 commit 817ee06

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

webcomponent/index.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<meta charset="utf-8">
55
<title>CDX Summary Tester</title>
66
<style>
7+
:root {
8+
--cdxsummary-thumb-scale: 0.3;
9+
}
710
body {
811
margin: 0;
912
}
@@ -46,15 +49,15 @@
4649
<script type="module" src="cdxsummary.js"></script>
4750
<script>
4851
const lists = {
49-
"attr": ["src", "item", "name", "report", "playback", "type", "format", "thumbs", "drawer"],
52+
"attr": ["src", "item", "name", "report", "playback", "type", "format", "thumbs", "fold"],
5053
"src": ["samples/MC.summary.json", "samples/EoT20.summary.json"],
5154
"item": ["mediacloud", "EndOfTerm2020WebCrawls", "epa-via-sitemap"],
5255
"type": ["CDX", "collection", "item"],
5356
"format": ["short", "percent", "local"]
5457
};
5558
const l = Math.max(...(lists["attr"].map(el => el.length)));
5659
const q = new URLSearchParams(location.search);
57-
const g = a => q.get(a) || '';
60+
const g = a => q.getAll(a).join(' ');
5861
const f = a => `<br>&nbsp;&nbsp;&nbsp;&nbsp;${a}${'&nbsp;'.repeat(l+1-a.length)}=&nbsp;&quot;`;
5962
const d = a => `<datalist id="${a}-list">${lists[a].map(i => `<option value="${i}">`).join('')}</datalist>`;
6063
const elm = `<cdx-summary ${lists["attr"].filter(a => q.has(a)).map(i => `${i}="${g(i)}"`).join(' ')}></cdx-summary>`;
@@ -73,8 +76,12 @@
7376
${f('format')}<input name="format" value="${g('format')}" placeholder="Default: local" list="format-list" class="narrow-input">&quot;
7477
${d('format')}
7578
${f('thumbs')}<input name="thumbs" value="${g('thumbs')}" type="number" min="0" placeholder="Thumbnail count" class="narrow-input">&quot;
76-
${f('drawer')}<input name="drawer" value="open" type="checkbox" id="drawer"${g('drawer')=='open' ? ' checked' : ''}>
77-
<label for="drawer">open</label>&quot;
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>&quot;
7885
<br>
7986
&gt;&lt;/cdx-summary&gt;
8087
<input type="submit" value="Render" class="submit">

0 commit comments

Comments
 (0)