LLWiki正在建设中,欢迎加入我们

“MediaWiki:Gadget-MobileCategories.js”的版本间差异

跳转到导航 跳转到搜索
标签移动版网页编辑 移动版编辑
 
api.get({ action:'parse',
text:allCatsJSON.mapstringify( (ele) => ele.title.substring(9) ).join('|') allCats),
contentmodel:'wikitext',
variant:mw.config.get('wgUserVariant')
}).then(function(data2) {
const contentCatsallCatsVar = data2.parse.text['*'].match(/<p>(.*)\n<\/p>/)[1].split('|');,
contentCats = JSON.parse(allCatsVar);
function categoryHtmlGenerator(element, index, array) {
$( '<a>' ).attr( 'href', mw.util.getUrl( element.title ) )
.attr( 'title', 'Category:' + title.title.replace(/_/g, ' ') )
.append( document.createTextNode( contentCats[index].title.substring(9) ) )
).get( 0 )
);
$( '<a>' ).attr( 'href', mw.util.getUrl( element.title ) )
.attr( 'title', 'Category:' + title.title.replace(/_/g, ' ') )
.append( document.createTextNode( contentCats[index].title.substring(9) ) )
).get( 0 )
);