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 130: Line 130:


         const results = dctResponse.query.results;
         const results = dctResponse.query.results;
       
        const testFunc = (dct, subfunctions) => subfunctions.some(func => {
                const printoutValue = dct.printouts[func][0];
                if (printoutValue) console.log(dct.name, func, printoutValue.fulltext);
                return printoutValue && printoutValue.fulltext.toLowerCase() === 'yes';
            })
           
         const dctList = Object.getOwnPropertyNames(results).map(dctKey => {
         const dctList = Object.getOwnPropertyNames(results).map(dctKey => {
             /** @type {DCT} */
             /** @type {DCT} */
Line 140: Line 149:
             dct.functions = [];
             dct.functions = [];


            const testFunc = (dct, subfunctions) => subfunctions.some(func => {
                const printoutValue = dct.printouts[func][0];


                if (printoutValue) console.log(dct.name, func, printoutValue.fulltext);
            console.log('result for', dctKey, testFunc(results[dctKey], searchFunctions))
 
                return printoutValue && printoutValue.fulltext.toLowerCase() === 'yes';
            })
 
            let x = testFunc(results[dctKey], searchFunctions)
            console.log('result for', dctKey, x)
             return dct;
             return dct;
         })
         })

Revision as of 14:50, 9 June 2022

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