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

m
oops
m (oops)
m (oops)
mw.hook('wikipage.content').add(function () {
 
const allicons = {};
'Stubs': [0x25D4],
'Partially complete articles': [0x25D2],
'Articles nearing completion': [0x25D5],
'Complete articles': [0x26AB, 0xFE0E],
}
 
// only on categories
gcmtype: "page",
}).then(function (response) {
const all = {};
response.query.pageids.forEach(function (id) {
const page = response.query.pages[id];
all[page.title] = page.categories.map(function(o){ return o.title});
})
console.log(all)
 
const all = {};
})
response.query.pageids.forEach(function (id) {
const page = response.query.pages[id];
all[page.title] = page.categories.map(function(o){ return o.title.replace('Category:','') });
})
 
document.querySelectorAll('#mw-pages a').forEach(el) {
Object.keys(icons).forEach(function (cat) {
const title = el.getAttribute('title')
const data = all[title]
if (!data.categories.includes(cat)) { continue }
console.log(alltitle, 'is a', cat)
})
})
 
})
 
 
})
40 275

ediciones