Difference between revisions of "Widget:GuidelinesList"

From LINKS Community Center
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 210: Line 210:
 
         #guideline-tabulator.tabulator .tabulator-row .tabulator-responsive-collapse {
 
         #guideline-tabulator.tabulator .tabulator-row .tabulator-responsive-collapse {
 
             border: 0 none;
 
             border: 0 none;
            padding: 0 .5em 2em 0;
 
 
         }
 
         }
  
Line 227: Line 226:
 
         #guideline-tabulator.tabulator .tabulator-row .tabulator-responsive-collapse table {
 
         #guideline-tabulator.tabulator .tabulator-row .tabulator-responsive-collapse table {
 
             font-size: smaller;
 
             font-size: smaller;
 +
        }
 +
 +
        #guideline-tabulator.tabulator .tabulator-row .tabulator-responsive-collapse table td {
 +
            white-space: normal;
 
         }
 
         }
  
Line 239: Line 242:
 
         }
 
         }
  
         .data-source-img,
+
         /* .data-source-img,
 
         .func-img {
 
         .func-img {
 
             width: 1.2rem;
 
             width: 1.2rem;
Line 246: Line 249:
 
             margin-bottom: .4rem;
 
             margin-bottom: .4rem;
 
             filter: grayscale(1);
 
             filter: grayscale(1);
         }
+
         } */
 
     </style>
 
     </style>
 
     <script>
 
     <script>
Line 331: Line 334:
  
 
         // Fetches platform / data source information.
 
         // Fetches platform / data source information.
         async function getSources() {
+
         // async function getSources() {
            const IMG_KEY = 'IMAGE';
+
        //    const IMG_KEY = 'IMAGE';
            const sourceResponse = await fetch(
+
        //    const sourceResponse = await fetch(
                getQueryUrl('[[Category:Social media platform]]|?' + IMG_KEY)
+
        //        getQueryUrl('[[Category:Social media platform]]|?' + IMG_KEY)
            ).then(response => response.json());
+
        //    ).then(response => response.json());
  
            return Object.keys(sourceResponse.query.results).map(platform => {
+
        //    return Object.keys(sourceResponse.query.results).map(platform => {
                const img = sourceResponse.query.results[platform].printouts[IMG_KEY][0];
+
        //        const img = sourceResponse.query.results[platform].printouts[IMG_KEY][0];
                return {
+
        //        return {
                    name: platform,
+
        //            name: platform,
                    image: img ? getFilePath(img.fulltext) : undefined
+
        //            image: img ? getFilePath(img.fulltext) : undefined
                };
+
        //        };
            });
+
        //    });
         }
+
         // }
  
 
         function applyFilters(clear) {
 
         function applyFilters(clear) {
            // TODO: apply Filters
 
 
             if (!table) return;
 
             if (!table) return;
  
Line 420: Line 422:
 
                 : true;
 
                 : true;
  
             return phaseCheck && thematicCheck && audienceExperiencesCheck && audienceTargetCheck && langCheck && sourcesCheck & techCheck;
+
             return phaseCheck && thematicCheck && audienceExperiencesCheck && audienceTargetCheck && langCheck && techCheck;
 
         }
 
         }
  
Line 476: Line 478:
 
             // groupedSources.push({ title: 'More platforms', sources: sourcesCopy });
 
             // groupedSources.push({ title: 'More platforms', sources: sourcesCopy });
  
             let dataSourceFilterHtml = '';
+
             // let dataSourceFilterHtml = '';
             groupedSources.forEach(group => {
+
             // groupedSources.forEach(group => {
                dataSourceFilterHtml += '<div class="filter-group-header">' + group.title + '</div>';
+
            //    dataSourceFilterHtml += '<div class="filter-group-header">' + group.title + '</div>';
                dataSourceFilterHtml += group.sources.reduce((acc, curr, idx) => {
+
            //    dataSourceFilterHtml += group.sources.reduce((acc, curr, idx) => {
                    const identifier = escapeAttr(curr.name);
+
            //        const identifier = escapeAttr(curr.name);
                    return acc +
+
            //        return acc +
                        '<div ' + (idx === 0 ? ' class="filter-group-start">' : '>') +
+
            //            '<div ' + (idx === 0 ? ' class="filter-group-start">' : '>') +
                        '<input type="checkbox" id="filter-' + identifier + '" value="' + curr.name + '">' +
+
            //            '<input type="checkbox" id="filter-' + identifier + '" value="' + curr.name + '">' +
                        '<label for="filter-' + identifier + '"><img src="' + curr.image + '"> ' + curr.name + '</label></div>'
+
            //            '<label for="filter-' + identifier + '"><img src="' + curr.image + '"> ' + curr.name + '</label></div>'
                }, '');
+
            //    }, '');
             });
+
             // });
             document.getElementById('data-source-filter').innerHTML = dataSourceFilterHtml;
+
             // document.getElementById('data-source-filter').innerHTML = dataSourceFilterHtml;
  
  
Line 782: Line 784:
 
                 applyFilters();
 
                 applyFilters();
 
             }, { passive: true });
 
             }, { passive: true });
             document.getElementById('data-source-filter').addEventListener('change', event => {
+
             // document.getElementById('data-source-filter').addEventListener('change', event => {
                applyFilters();
+
            //    applyFilters();
             }, { passive: true });
+
             // }, { passive: true });
 
             document.getElementById('tech-filter').addEventListener('change', event => {
 
             document.getElementById('tech-filter').addEventListener('change', event => {
 
                 applyFilters();
 
                 applyFilters();

Latest revision as of 14:48, 18 July 2023

Current version of the List of Guidelines.
Currently in use – do not modify!