Difference between revisions of "Widget:DCTList"

From LINKS Community Center
Jump to: navigation, search
Line 362: Line 362:
 
             const dataSources = data[0];
 
             const dataSources = data[0];
 
             const { dcts, funcData } = data[1];
 
             const { dcts, funcData } = data[1];
 
            console.log(funcData)
 
  
 
             // The keys of this object must match function category names EXACTLY.
 
             // The keys of this object must match function category names EXACTLY.
Line 496: Line 494:
 
                 if (!(filter && filter.type)) { summary.textContent = 'No filter.'; return; }
 
                 if (!(filter && filter.type)) { summary.textContent = 'No filter.'; return; }
  
                 // Exit if none of the filters are present.
+
                 // Update filter text.
 
                 if (
 
                 if (
 
                     !filter.type.functions &&
 
                     !filter.type.functions &&
 
                     !filter.type.dataSources
 
                     !filter.type.dataSources
                 ) { summary.textContent = 'No filter.'; return; }
+
                 ) { summary.textContent = 'No filter.'; }
 
+
                 else {
                 // Construct filter summary
+
                    let summaryHtml = '<table>';
                let summaryHtml = '<table>';
+
                    if (filter.type.functions) {
                if (filter.type.functions) {
+
                        summaryHtml += '<tr><td><strong>Functions</strong></td><td>'
                    summaryHtml += '<tr><td><strong>Functions</strong></td><td>'
+
                            + (filter.type.functions.length > 0 ? filter.type.functions.join(', ') : 'none')
                        + (filter.type.functions.length > 0 ? filter.type.functions.join(', ') : 'none')
+
                            + '</td></tr>';
                        + '</td></tr>';
+
                    }
                }
+
                    if (filter.type.dataSources) {
                if (filter.type.dataSources) {
+
                        summaryHtml += '<tr><td><strong>Platforms</strong></td><td>'
                    summaryHtml += '<tr><td><strong>Platforms</strong></td><td>'
+
                            + (filter.type.dataSources.length > 0 ? filter.type.dataSources.join(', ') : 'none')
                        + (filter.type.dataSources.length > 0 ? filter.type.dataSources.join(', ') : 'none')
+
                            + '</td></tr>';
                        + '</td></tr>';
+
                    }
 +
                    summaryHtml += '</table>';
 +
                    summary.innerHTML = summaryHtml;
 
                 }
 
                 }
                summaryHtml += '</table>';
 
                summary.innerHTML = summaryHtml;
 
  
 
                 const markImages = () => {
 
                 const markImages = () => {

Revision as of 13:39, 7 September 2022

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