Diferencia entre revisiones de «MediaWiki:Gadget-show-quality-on-cats.js»

m
try
m (oops)
m (try)
console.debug(response)
 
const all = {};
response.query.pageids.forEach(function (id) {
const page = response.query.pages[id];
if (!page.categories) return
all[page.title] = page.categories.map(function(o){ return o[0].title.replace('Category:','') });
})
 
document.querySelectorAll('#mw-pages a').forEach(function (el) {
Object.keys(icons).forEach(function (cat) {
const title = el.getAttribute('title')
const data = all[title]
const icon = String.fromCodePoint.apply(null, icons[cat])
el.parentElement.append(icon)
})
})
 
40 275

ediciones