User:Th3Y3ll0wL3m0n/global.js

// JS Imports //

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

/* Restores the post button to redirect to user's Discussions posts as it did on Legacy */ mw.loader.using('mediawiki.api', function {   'use strict';    var user = mw.config.get('wgRelevantUserName');    if ( window.DiscussionPLReady || !user ) return;   window.DiscussionPLReady = true;    var api = new mw.Api,        data, id;    api.get({ action: 'query', list: 'users', ususers: user }).then(function(d) { data = d.query.users; if (!data.length) return; id = data[0].userid; var interval = setInterval(function {           if ($('#userProfileApp .user-profile-navigation').length) {                clearInterval(interval);                var identity = $('.user-identity-stats a[href^="/wiki/Special:UserProfileActivity/'+user+'"]');                if (identity.length) {                    identity.each(function { $(this).attr('href', '/f/u/'+id); });               }            }        }, 1000);    }); });