User:Blaster Niceshot/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CodeEditorSwitch/code.js',        'u:dev:EditBio/code.js',        'u:dev:MediaWiki:GlobalNavBehavior.js',    ] });

/** * Gets information about wiki's use of RailWAM for debugging. */ mw.hook('rw.api.ready').add(function {    'use strict';    if (typeof window.railWAM === 'object') {        const body = $('body'),            userMenu = $('.wds-global-navigation__user-menu .wds-dropdown__content');        userMenu.removeClass('wds-is-scrollable').addClass('wds-is-not-scrollable');        $('.wds-list li:nth-child(3)', userMenu).after(' RailWAM   WAM LogDebug ModeConfig</a></li></ul> </li>'); $('#bniceshot-debug-link').attr('href', function {           var url = window.location.href;            const debugParam = /debug=.*?(?=$|&|#)/.test(url) ? url.match(/debug=.*?(?=$|&|#)/)[0] : null;            if (typeof debugParam === 'string') {                url = url.replace(debugParam, );                if (/\?\w/.test(url) === false) {                    url = url.replace('?', );                }                return url;            } else if (url.includes('?')) {                return url.replace('?', '?debug=true&');            } else if (url.includes('#')) {                return url.replace('#', '?debug=true#');            } else {                return url + '?debug=true';            }        }); $('#bniceshot-config-link').click(           function {                var configListHTML = '';                $.each(window.railWAM, function(prop, val){ if (typeof val === 'string') { val = '\ + val + '\; }                       configListHTML += '  ' + prop + ' : ' + val + '  '; }               );                $.showCustomModal('RailWAM Configuration', configListHTML);            }        ); } });