User:RogueScholar/userbox.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:RogueScholar/userbox. |
$.when( mw.loader.using('mediawiki.util'), $.ready ).then( function() {
mw.util.addPortletLink( 'p-personal', mw.util.getUrl( 'Special:PrefixIndex/User_talk:' ) + mw.config.get( 'wgUserName' ) + '/',
'My talk subpages', 'pt-mytalksubs', 'Show your Usertalk-space subpages', null, '#pt-preferences' );
mw.util.addPortletLink( 'p-personal', mw.util.getUrl( 'Special:PrefixIndex/User:' ) + mw.config.get( 'wgUserName' ) + '/',
'My subpages', 'pt-mysubpages', 'Show your User-space subpages', null, '#pt-mytalksubs' );
mw.util.addPortletLink( 'p-navigation', 'https://tools.wmflabs.org/scholia/',
'Scholia', 'p-scholia', 'Scientometrics tool', null, null );
mw.util.addPortletLink( 'p-navigation', 'http://weekly.hatnote.com/archive/en/index.html',
'Weeklypedia', 'p-weeklypedia', 'Top edited articles', null, '#p-scholia' );
mw.util.addPortletLink( 'p-navigation', mw.util.getUrl( 'Special:Nearby' ),
'Nearby', 'p-nearby', 'Articles near your current location', null, '#p-weeklypedia' );
} );
$.when( mw.loader.using('mediawiki.util'), $.done ).then( function () {
$("#p-tb").append("<div id='p-labsbox' class='mw-portlet' role='navigation', aria-labelledby='p-labsbox-label'><h3 id='p-userbox-label'>XTools</h3><div class='body'><ul></ul></div></div>");
mw.util.addPortletLink( 'p-labsbox',
'https://tools.wmflabs.org/topviews/?project=wiki.riteme.site&platform=all-access&date=last-month&excludes=', 'Top views', 'p-topviews', 'Most viewed articles in the last month-to-date', null, null );
mw.util.addPortletLink( 'p-labsbox',
'https://xtools.wmflabs.org/topedits/wiki.riteme.site/' + mw.config.get('wgUserName'), 'Top edits', 'p-topedits', 'Most edited pages by namespace', null, '#p-topviews' );
mw.util.addPortletLink( 'p-labsbox',
'https://tools.wmflabs.org/supercount/index.php?project=wiki.riteme.site&user=' + mw.config.get('wgUserName'), 'Supercount', 'p-supercount', 'Global MediaWiki account statistics', null, '#p-topedits' );
mw.util.addPortletLink( 'p-labsbox',
'https://tools.wmflabs.org/xtools/pages/?user=' + mw.config.get('wgUserName') + '&project=wiki.riteme.site&namespace=0&redirects=noredirects', 'Created pages', 'p-createdpages', 'Pages added to Wikipedia', null, '#p-supercount' );
mw.util.addPortletLink( 'p-labsbox',
'https://tools.wmflabs.org/userviews/?project=wiki.riteme.site&platform=all-access&agent=user&namespace=all&redirects=2&range=all-time&sort=views&direction=1&view=list&user=' + mw.config.get('wgUserName'), 'All-time Userviews', 'p-userviews', 'All-time hits for all pages created', null, '#p-createdpages' );
} );