Jump to content

User:PAC2/userbox.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.
mw.loader.using('mediawiki.util', function () { 

$("#p-pagemisc").append("<div id='p-userbox' class='mw-portlet' role='navigation', aria-labelledby='p-userbox-label'><h3 id='p-userbox-label'>User box</h3><div class='body'><ul></ul></div></div>") ; 

var userbox = function ($) { 

mw.util.addPortletLink( portletID = 'p-userbox', href = 'https://tools.wmflabs.org/userviews/?project=en.wikipedia.org&platform=all-access&agent=user&namespace=0&redirects=0&range=latest-20&sort=views&direction=1&view=list&user=' + mw.config.get('wgUserName'), text = 'User views', id = 'p-userviews' ); 

mw.util.addPortletLink( portletID = 'p-userbox', href = 'https://tools.wmflabs.org/xtools/pages/?user=' + mw.config.get('wgUserName') + '&project=en.wikipedia.org&namespace=0&redirects=noredirects', text = 'Created pages', id = 'p-createdpages' ) ; 

mw.util.addPortletLink( portletID = 'p-userbox', href = 'https://xtools.wmflabs.org/topedits/en.wikipedia.org/' + mw.config.get('wgUserName'), text = 'Top Edits', id = 'p-topedits' ); 

mw.util.addPortletLink( portletID = 'p-userbox', href = 'https://tools.wmflabs.org/supercount/index.php?project=en.wikipedia.org&user=' + mw.config.get('wgUserName'), text = 'Supercount', id = 'p-supercount' ); 

mw.util.addPortletLink( portletID = 'p-userbox', href = 'https://en.wikipedia.org/wiki/Sp%C3%A9cial:Index/User:' + mw.config.get('wgUserName'), text = 'Subpages', id = 'p-souspages' ); 

} 

$(document).ready(userbox); 

});