User:Begoon/addVectorLinks.js

Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
//called from vector.js
//add/alter some links in Vector interface

//ensure mediawiki.util loaded
mw.loader.using( 'mediawiki.util', function () {
//call on page load
jQuery( function( $ ) {

//sandbox link
mw.util.addPortletLink('p-personal','/w/index.php?title=Special:MyPage/sandbox','Sandbox','pt-mysandbox', 'Go to your sandbox', null, '#pt-preferences' );


//Alternative uploads link - show 250 - no old versions
//remove old link
var WlElemU = document.getElementById("pt-uploads");
if(WlElemU) {
	WlElemU.parentNode.removeChild(WlElemU);
}
//add new link
var rUser = mw.config.get('wgUserName');
mw.util.addPortletLink('p-personal', '/wiki/Special:ListFiles?limit=250&user=' + rUser.replace(/ /g, '+'), 'Uploads', 'pt-uploads', 'List of files uploaded', null, '#pt-mycontris' );


//Use basic upload form
//remove old link
var WlElemF = document.getElementById("n-uploadbtn");
if(WlElemF) {
	WlElemF.parentNode.removeChild(WlElemF);
}
//add new link
mw.util.addPortletLink('p-participate','/w/index.php?title=Special:Upload&uselang=experienced','Upload file','n-uploadbtn', 'Basic upload form', null, '#n-recentchanges' );

//Change the Crop tool link text
if ($('#t-crop').length > 0) {
  document.getElementById('t-crop').getElementsByTagName('a')[0].innerHTML="Crop this image";
}

/////////////////////
//close functions
}); //jQuery( function( $ ) {
}); //mw.loader.using( 'mediawiki.util', function () {