MediaWiki:ChatBanLogModal.js

//ChatBanLogModal by Sophiedp //Shows the ban log in a modal popup instead of a new page //Use your browser's "open link in new tab" feature if you need to actually go to the page. if (mw.config.get('wgCanonicalSpecialPageName') === 'Contributions') { $.get($('.chat-ban-log').attr('href'), function (data) {       mw.util.addCSS('#BanLogModal { position: fixed; top: 50px !important; }');        $('body').on('click', '.chat-ban-log', function (e) { e.preventDefault; var BanLogTitle = $(data).find('#mw-content-text > p:first-child').text; if ($(data).find('#mw-content-text > ul').exists) { var BanLogContent = $(data).find('#mw-content-text > ul').html; } else { var BanLogContent = $(data).find('#mw-content-text > p:nth-child(3)').text.trim; }           $.showModal(BanLogTitle, BanLogContent, {                id: 'BanLogModal',                buttons: [{                    defaultButton: true,                    handler: function  {                        $('#BanLogModal').closeModal;                    }                }]            }); });   }); }