Jump to content

User:Enterprisey/more-listing-items.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
$( function () {
    if( !document.getElementsByClassName( "mw-numlink" ).length ) return;
    function adjustCount( oldUrl, count ) {
        return $( "<a>" ).attr( "href", oldUrl.replace( "&limit=500", "&limit=" + count ) ).text( count );
    }
    $( ".mw-numlink:contains(500)" ).each( function () {
        var oldUrl = $( this ).attr( "href" );
        $( this ).after( " | ",
                adjustCount( oldUrl, 1000 ), " | ",
                adjustCount( oldUrl, 2500 ), " | ",
                adjustCount( oldUrl, 5000 ) );
    } );
} );
// </nowiki>