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

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

跳转到导航 跳转到搜索
删除10字节 、​ 2020年12月22日 (二) 01:06
无编辑摘要
const list = mw.storage.getObject( 'inspect-category' );
if (!list) { return id + 1; }
if (list[0][ list.currentIndex[1] ] == id) {
list.currentIndex[1]++;
mw.storage.setObject( 'inspect-category', list );
}
return list[0][ list.currentIndex[1] ];
},
btns = [new OO.ui.ButtonWidget({label: '提交', flags: ['primary', 'progressive']}).on('click', () => {
formatversion: 2}).then(cm => {
console.log(`End API request: 已获得分类下的页面列表,用时 ${mw.now() - now} ms`);
letconst pages = cm.query.categorymembers.map(ele => ele.pageid).sort((a, b) => a > b);
if (pages.length === 0) {
mw.notify('该分类下无页面!', {type: 'warn'});
return;
}
pagesconst currentIndex = $.extend(pages, {currentIndex: pages[0] == id ? 1 : 0});
mw.storage.setObject( 'inspect-category', [pages, currentIndex] );
btns[4].setHref( `/?redirect=no&curid=${pages[ pages.currentIndex ]}` );
}, reason => { mw.notify(`无法获得该分类下的页面列表!错误信息:${reason}`, {type: 'error'}); });
}, reason => { mw.notify(`无法获得页面名称!错误信息:${reason}`, {type: 'error'}); });
16,874

个编辑

导航菜单