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

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

跳转到导航 跳转到搜索
删除1,228字节 、​ 2021年10月27日 (三) 12:29
无编辑摘要
// 改变CSS样式表示预览中
btns[1].setDisabled( true );
mw.timedParse(api, {text: editor.getValue(), uselang: lang, prop: 'text|categoriescategorieshtml|displaytitle|indicators'},
wgULS('预览', '預覽')).then(r => {
if ($.contains( $content[0], $original[0] )) {
if (mw.resizeLyrics) { mw.resizeLyrics(); }
mw.hook( 'wikipage.content' ).fire($content);
$('#catlinks').replaceWith( $parseCatr.parse.categorieshtml );
placeholder[1].html( r.parse.displaytitle );
placeholder[3].html( Object.entries( r.parse.indicators ).map(ele =>
$('<div>', {class: 'mw-indicator', id: `mw-indicator-${ele[0]}`, html: ele[1]})) );
const showhidden = mw.user.options.get( 'showhiddencats' ),
normalCats = r.parse.categories.filter(ele => !ele.hidden).map(ele => ele.category),
hiddenCats = (showhidden ? r.parse.categories.filter(ele => ele.hidden) : []).map(ele => ele.category);
if (normalCats.length + hiddenCats.length === 0) { return; }
const $parseCat = $('<div>', {id: 'catlinks', class: 'catlinks', 'data-mw': 'interface'});
if (normalCats.length) {
$parseCat.append( $('<div>', {id: 'mw-normal-catlinks', class: 'mw-normal-catlinks', html: [
$('<a>', {title: wgULS('页面分类', '頁面分類'), text: wgULS('分类', '分類'),
href: '/zh/special:页面分类'}),
':',
$('<ul>', {html: normalCats.map(ele => $('<li>', {html: $('<a>',
{href: mw.util.getUrl( `Category:${ele}` ), title: `Category:${ele}`, text: ele})
}))})
]}) );
}
if (hiddenCats.length) {
$parseCat.append( $('<div>', {id: 'mw-hidden-catlinks',
class: 'mw-hidden-catlinks mw-hidden-cats-user-shown', html: [
wgULS('隐藏分类:', '隱藏分類:'),
$('<ul>', {html: hiddenCats.map(ele => $('<li>', {html: $('<a>', {href: mw.util.getUrl(ele),
title: `Category:${ele}`, text: ele})}))})
]}) );
}
$('#catlinks').replaceWith( $parseCat );
}, () => {}).then(() => { btns[1].setDisabled( false ); });
}), new OO.ui.ButtonWidget({label: wgULS('还原', '復原'), flags: 'destructive', disabled: true}).on('click', () => {
16,874

个编辑

导航菜单