Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 272: | Line 272: | ||
// The keys of this object must match function category names EXACTLY. | // The keys of this object must match function category names EXACTLY. | ||
// TODO: Link images to categories directly. | |||
const fnImages = { | const fnImages = { | ||
'Search and Monitor': '/index.php/Special:FilePath/File:Func_search.svg', | 'Search and Monitor': '/index.php/Special:FilePath/File:Func_search.svg', | ||
Line 286: | Line 287: | ||
const functionFilterHtml = Object.keys(fnImages).reduce((acc, funcName) => { | const functionFilterHtml = Object.keys(fnImages).reduce((acc, funcName) => { | ||
const identifier = escapeAttr(funcName); | const identifier = escapeAttr(funcName); | ||
return acc + '<div><input type="checkbox" id="func-filter-' + identifier + '" value="' + funcName + '" | return acc | ||
'<label for="func-filter-' + identifier + '"><img src="' + fnImages[funcName] + '"> ' + funcName + '</label></div>' | + '<div><input type="checkbox" checked id="func-filter-' + identifier | ||
+ '" value="' + funcName + '">' | |||
+ '<label for="func-filter-' + identifier | |||
+ '"><img src="' + fnImages[funcName] + '"> ' + funcName + '</label></div>' | |||
}, ''); | }, ''); | ||
document.getElementById('functions-filter').innerHTML = functionFilterHtml; | document.getElementById('functions-filter').innerHTML = functionFilterHtml; |
Revision as of 09:08, 6 September 2022
Development verstion of the DCT List.
Not ready for production!