User:Amakuru/Contributions.js

mw.loader.using(['mediawiki.api', 'mediawiki.util'], function { "use strict";

function navigateToContributions { window.location.href = "https://en.wikipedia.org/wiki/Special:Contributions/Amakuru"; }

function navigateToSandbox1 { window.location.href = "https://en.wikipedia.org/wiki/User:Amakuru/sandbox"; }

function navigateToSandbox2 { window.location.href = "https://en.wikipedia.org/wiki/User:Amakuru/Sandbox"; }

function navigateToWatchlist { window.location.href = "https://en.wikipedia.org/wiki/Special:Watchlist"; }

function addToolbarPortletLink(func, text) { var link = mw.util.addPortletLink(		'p-tb',		'#',		text,		't-contributions',		text	); $( link ).click( function (e) {		e.preventDefault;		func;	}); }

// Add toolbar portlet links addToolbarPortletLink(navigateToContributions, 'Contributions'); addToolbarPortletLink(navigateToSandbox1, 'Sandbox 1'); addToolbarPortletLink(navigateToSandbox2, 'Sandbox 2'); addToolbarPortletLink(navigateToWatchlist, 'Watchlist'); });