User:Bradv/endlesscontribs.js

In this article, we are going to delve into User:Bradv/endlesscontribs.js, a topic that has aroused great interest in today's society. User:Bradv/endlesscontribs.js is a concept that has gained relevance in various fields, from science to popular culture, and its influence has spread significantly in recent times. Along these lines, we will explore the different facets and dimensions of User:Bradv/endlesscontribs.js, analyzing its impact on everyday life, its relevance in the academic field, as well as its presence in technology and entertainment. Through a multidisciplinary approach, we aim to shed light on User:Bradv/endlesscontribs.js and offer a comprehensive view of this phenomenon that has captured the attention of numerous individuals and groups in contemporary society.
(function( $, mw ) {
    'use strict';
    
    if (mw.config.get('wgCanonicalSpecialPageName')==='Contributions') {
        mw.loader.using("mediawiki.util").then(function () {
            const css = mw.util.addCSS(`
                body.endlesscontribs .mw-pager-navigation-bar:not(:first-of-type) {
                    display: none;
                }
                #endlesscontribs {
                    margin: 1em;
                }
            `)

            var nexturl = $('a').attr('href');
            if (nexturl) {
                var loading = false;

                const button = $('<span>', {
                    'id': 'endlesscontribs',
                    'class': 'mw-ui-button mw-ui-progressive'})
                .text('Load more')
                .insertAfter($('.mw-pager-body'))
                .click(function () {
                    $('body').addClass('endlesscontribs');
                    if (!loading) {
                        loading = true;
                        $.get(nexturl, function(data) {
                            var $html = $(data);
                            const $ul = $('.mw-contributions-list');
                            const $newul = $html.find('.mw-contributions-list > li');
                            $newul.each(function (index, element) {
                                $ul.append($(element));
                            })

                            nexturl = $html.find('a').attr('href');

                            if (!nexturl) {
                                button.remove();
                            }
                            loading = false;
                        })
                    }
                });                
            }
        });
    }
}(jQuery, mediaWiki ));