MediaWiki:Common.js
外观
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* Common.js — site-wide JavaScript */
/* Hide the main page (首页) entry from the AllPages list on the homepage */
$( function () {
var allpages = document.querySelector( '.mw-allpages-chunk' );
if ( !allpages ) { return; }
allpages.querySelectorAll( 'li' ).forEach( function ( li ) {
var a = li.querySelector( 'a' );
if ( a && ( a.title === '首页' || a.title === 'Main Page' ) ) {
li.remove();
}
} );
} );