Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 73: | Line 73: | ||
let table; | let table; | ||
const FN_SEARCH = 'Search & Monitor'; | const FN_SEARCH = 'Search & Monitor'; | ||
const FN_POST = 'Post & Schedule'; | const FN_POST = 'Post & Schedule'; | ||
const getUrl = title => title ? '/index.php/Special:FilePath/' + title : title; | |||
const escapeAttr = text => text ? text.replace(/\s/g, '-') : text; | |||
const hasFunction = (dctResult, subfunctions) => subfunctions.some(func => | const hasFunction = (dctResult, subfunctions) => subfunctions.some( | ||
func => dctResult.printouts[func][0] && dctResult.printouts[func][0].fulltext.toLowerCase() === 'yes' | |||
); | |||
async function getSources() { | async function getSources() { | ||
Line 136: | Line 129: | ||
const results = dctResponse.query.results; | const results = dctResponse.query.results; | ||
const dctList = Object.getOwnPropertyNames(results).map(dctKey => { | const dctList = Object.getOwnPropertyNames(results).map(dctKey => { | ||
/** @type {DCT} */ | /** @type {DCT} */ | ||
const dct = {}; | const dct = {}; | ||
const dctResult = results[dctKey]; | |||
dct.name = dctKey; | dct.name = dctKey; | ||
dct.url = dctResult.fullurl; | dct.url = dctResult.fullurl; |
Revision as of 15:52, 9 June 2022
Development verstion of the DCT List.
Not ready for production!