Jump to content

MediaWiki:Common.js: Difference between revisions

From Gyaanipedia
m Protected "MediaWiki:Common.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
No edit summary
Tags: Manual revert Mobile edit Mobile web edit
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
// Run this code only on the Special:AllPages page
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Allpages' ) {
    $( function() {
        // Regular expression to test if a title is *only* digits
        var numericRegex = /^[0-9]+$/;
        // Iterate over all links in the main content area
        $( '#mw-content-text a' ).each( function() {
            var title = $( this ).attr( 'title' );
            if ( title && numericRegex.test( title ) ) {
                // Find the parent list item and hide it
                $( this ).closest( 'li' ).hide();
            }
        } );
    } );
}

Latest revision as of 12:23, 6 December 2025

/* Any JavaScript here will be loaded for all users on every page load. */