Difference between revisions of "Widget:DCTList"

From LINKS Community Center
Jump to: navigation, search
Line 394: Line 394:
 
             // If filtering property is empty, don't apply the filter (set the check to true).
 
             // If filtering property is empty, don't apply the filter (set the check to true).
 
             // Passing an empty object (as with applyFilters(true)) should result in an unfiltered table.
 
             // Passing an empty object (as with applyFilters(true)) should result in an unfiltered table.
 
            // TEMPORARY!!!
 
            const dctFunctions = Array.from(dct.functions.values()).map(val => val.functions).flat()
 
            // TEMPORARY!!!
 
            // TODO: REWORK
 
  
 
             let functionsCheck = true;
 
             let functionsCheck = true;
Line 773: Line 768:
 
             // Set up the table if parameter was passed.
 
             // Set up the table if parameter was passed.
 
             const params = new URLSearchParams(window.location.search);
 
             const params = new URLSearchParams(window.location.search);
             const enc = params.get('do');
+
             const encoded = params.get('do');
            console.log(enc)
+
 
             if (enc) {
+
             if (encoded) {
                 const decoded = JSON.parse(decodeURIComponent(atob(enc)));
+
                 const action = JSON.parse(decodeURIComponent(atob(encoded)));
                 console.log(decoded)
+
                 if (action.filter) {
 +
                    Object.keys(action.filter).forEach(fnCat => {
 +
                        const fnBlock = document.getElementById('func-filter-' + escapeAttr(fnCat)).closest('.func-filter-block');
 +
                        fnBlock.querySelectorAll('input[type="checkbox"]').forEach(box => box.checked = actions.filter[fnCat]);
 +
                    });
 +
                }
 
             }
 
             }
 
         });
 
         });

Revision as of 15:07, 24 November 2022

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