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 226: Line 226:
         const dcts = data[1];
         const dcts = data[1];


         dataSources.unshift(dataSources.splice(dataSources.findIndex(src => src.name === 'Web'), 1)[0]);
         // dataSources.unshift(dataSources.splice(dataSources.findIndex(src => src.name === 'Web'), 1)[0]);
         dataSources.unshift(dataSources.splice(dataSources.findIndex(src => src.name === 'Crowd'), 1)[0]);
         // dataSources.unshift(dataSources.splice(dataSources.findIndex(src => src.name === 'Crowd'), 1)[0]);


         // Set up filters.
         // Set up filters.
         const groupedSources = [];
         const groupedSources = [];
        const sourcesCopy = Array.from(dataSources);
         for (const layoutGroup of sourcesLayout) {
         for (const layoutGroup of sourcesLayout) {
             const group = [];
             const group = [];
             for (const source of layoutGroup) {
             for (const source of layoutGroup) {
                 let idx = dataSources.findIndex(src => src.name === source);
                 let idx = sourcesCopy.findIndex(src => src.name === source);
                 if (idx !== -1) {
                 if (idx !== -1) {
                     group.push(dataSources.splice(idx, 1)[0]);
                     group.push(sourcesCopy.splice(idx, 1)[0]);
                 }
                 }
             }
             }
             if (group.length > 0) groupedSources.push(group);
             if (group.length > 0) groupedSources.push(group);
         }
         }
         groupedSources.push(dataSources);
         groupedSources.push(sourcesCopy);





Revision as of 14:52, 13 June 2022

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