Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 228: Line 228:


         // Set up filters.
         // Set up filters.
        const functionFilterHtml = Object.getOwnPropertyNames(fnImages).reduce(funcName => {
            const identifier = escapeAttr(funcName);
            return '<div><input type="checkbox" id="func-filter-' + identifier + '" value="' + funcName + '" checked>' +
                '<label for="func-filter-' + identifier + '"><img src="' + fnImages[funcName] + '"> ' + funcName + '</label></div>'
        }, '');
        document.getElementById('data-source-filter').innerHTML = dataSourceFilterHtml;
         const groupedSources = [];
         const groupedSources = [];
         const sourcesCopy = Array.from(dataSources);
         const sourcesCopy = Array.from(dataSources);
Line 240: Line 247:
         groupedSources.push(sourcesCopy);
         groupedSources.push(sourcesCopy);


         let filterHtml = '';
         let dataSourceFilterHtml = '';
         groupedSources.forEach(group => {
         groupedSources.forEach(group => {
             filterHtml += group.reduce((prev, curr, idx) => {
             dataSourceFilterHtml += group.reduce((prev, curr, idx) => {
                 const identifier = escapeAttr(curr.name);
                 const identifier = escapeAttr(curr.name);
                 return prev + '<div ' + (idx === 0 ? ' class="filter-group-start">' : '>') +
                 return prev + '<div ' + (idx === 0 ? ' class="filter-group-start">' : '>') +
Line 249: Line 256:
             }, '');
             }, '');
         })
         })
         document.getElementById('data-source-filter').innerHTML = filterHtml;
         document.getElementById('functions-filter').innerHTML = dataSourceFilterHtml;


         // Set up table.
         // Set up table.

Revision as of 15:42, 13 June 2022

Development verstion of the DCT List.
Not ready for production!