Widget: DevGuidelines: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Cschwentker (talk | contribs)
No edit summary
Cschwentker (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 325: Line 325:
                 guideline[EX_PROP] = guidelineResult.printouts[EX_PROP].map(value => value.fulltext);
                 guideline[EX_PROP] = guidelineResult.printouts[EX_PROP].map(value => value.fulltext);
                 guideline[YEAR_PROP] = guidelineResult.printouts[YEAR_PROP][0] && guidelineResult.printouts[YEAR_PROP][0].raw.slice(-4);
                 guideline[YEAR_PROP] = guidelineResult.printouts[YEAR_PROP][0] && guidelineResult.printouts[YEAR_PROP][0].raw.slice(-4);
                 guideline[TECH_PROP] = guidelineResult.printouts[TECH_PROP].map(value => value.fulltext).sort();
                 guideline[TECH_PROP] = guidelineResult.printouts[TECH_PROP].map(value => value.fulltext);
                 return guideline;
                 return guideline;
             });
             });
Line 385: Line 385:
             const techOptions = Array.from(document.querySelectorAll('#tech-filter input[type="checkbox"]'));
             const techOptions = Array.from(document.querySelectorAll('#tech-filter input[type="checkbox"]'));
             const selectedTechs = techOptions.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
             const selectedTechs = techOptions.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
             filterState.techs = selectedTechs.length === techOptions.length ? undefined : techOptions;
             filterState.techs = selectedTechs.length === techOptions.length ? undefined : selectedTechs;


             table.setFilter(guidelineFilter, filterState);
             table.setFilter(guidelineFilter, filterState);
Line 529: Line 529:
             }, '');
             }, '');
             document.getElementById('audience-experience-filter').innerHTML = targetAudienceExperienceHtml;
             document.getElementById('audience-experience-filter').innerHTML = targetAudienceExperienceHtml;
 
         
             let techHtml = Array.from(MENTIONS_TECHNOLOGIES_VALUES.values()).reduce((acc, curr) => {
             let techHtml = Array.from(MENTIONS_TECHNOLOGIES_VALUES.values()).reduce((acc, curr) => {
                 const identifier = escapeAttr(curr);
                 const identifier = escapeAttr(curr);
Line 686: Line 686:
                             + '</td></tr>';
                             + '</td></tr>';
                     }
                     }
                     if (filter.type.tech) {
                     if (filter.type.techs) {
                         summaryHtml += '<tr><td><strong>Mentions Technologies</strong></td><td>'
                         summaryHtml += '<tr><td><strong>Mentions Technologies</strong></td><td>'
                             + (filter.type.tech.length > 0 ? filter.type.tech.join(', ') : 'none')
                             + (filter.type.techs.length > 0 ? filter.type.techs.join(', ') : 'none')
                             + '</td></tr>';
                             + '</td></tr>';
                     }
                     }

Latest revision as of 16:08, 24 November 2022

Development version of the List of Guidelines.
Not ready for production!