Diferencia entre revisiones de «MediaWiki:Gadget-show-quality-on-cats.js»
Ir a la navegación
Ir a la búsqueda
m (try) |
m (try) |
||
Línea 18: | Línea 18: | ||
}).then(function (response) { |
}).then(function (response) { |
||
console.log(response.query) |
console.log(response.query) |
||
for(const id of response.query.pageids) { console.log(id) } |
|||
}) |
}) |
||
Revisión del 06:47 13 ago 2019
mw.hook('wikipage.content').add(function () { // only on categories if (mw.config.get('wgCanonicalNamespace') != 'Category') return console.warn('gadget:', 'show-quality-markers') ;(new mw.Api).get({ action: "query", format: "json", prop: "categories", indexpageids: true, cllimit: "max", generator: "categorymembers", gcmtitle: mw.config.get('wgPageName'), gcmlimit: "max", gcmtype: "page", }).then(function (response) { console.log(response.query) for(const id of response.query.pageids) { console.log(id) } }) })