Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 437: | Line 437: | ||
const { dcts, funcData } = data[1]; | const { dcts, funcData } = data[1]; | ||
let | // Set up functions filter | ||
let funcFilterHtml = '<div>'; | |||
Array.from(funcData).forEach(([fnCat, fnInfo], index) => { | |||
const identifier = 'func-filter-' + escapeAttr(fnCat); | const identifier = 'func-filter-' + escapeAttr(fnCat); | ||
funcFilterHtml += | |||
`<div> | |||
<input type="checkbox" checked id="${identifier}" value="${fnCat}"> | |||
<label for="${identifier}"><img src="${fnImages[fnCat]}"> ${fnCat}</label> | |||
</div>`; | |||
// add subfunctions | |||
if (index < 3) { | |||
for (const func of fnInfo.functions) { | |||
const subfuncId = 'subfunc-filter-' + escapeAttr(func); | |||
funcFilterHtml += | |||
`<div class="subfunc-filter"> | |||
<input type="checkbox" checked id="${subfuncId}" value="${func}"> | |||
<label for="${subfuncId}">${func}</label> | |||
</div>`; | |||
} | |||
} | |||
funcFilterHtml += '</div>'; | |||
}); | |||
document.getElementById('functions-filter').innerHTML = funcFilterHtml; | |||
// Set up sources filter | |||
const groupedSources = []; | const groupedSources = []; | ||
const sourcesCopy = Array.from(dataSources); | const sourcesCopy = Array.from(dataSources); |
Revision as of 10:48, 17 November 2022
Development verstion of the DCT List.
Not ready for production!