User:PersistentMix/common.js

/** * Contribution link on User and User talk */

(function ($, mw) { if (mw.config.get('wgNamespaceNumber') === 2 || mw.config.get('wgNamespaceNumber') === 3) {      mw.util.addPortletLink( 'p-namespaces', mw.util.getUrl('Special:Contributions/' + mw.config.get('wgRelevantUserName')), 'Contributions', 'ca-nstab-contributions', 'User\'s contributions' ); } })(jQuery, mediaWiki);

/** * Download link on file page */ (function($, mw){	if (!(mw.config.get('wgNamespaceNumber') === 6 && $('.fullMedia, .filehistory').length > 0)) {		return;	}	function addLinks {		// below image, replace image name with page title		$('.fullMedia a.internal').after( ' (',			$('')				.text('download')				.addClass('fileDownload')				.attr({ href: $('.fullMedia a.internal').attr('href'), download: mw.config.get('wgTitle').replace('_', ' '), title: 'Download this file' }),			')'		);		// file history, leave numbers in file name		$('.filehistory tr td[style]').each(function { var $this = $(this); $this.append(				$(' '),				$('')					.text('Download')					.addClass('fileDownload')					.attr({ download: '', href: $this.find('a').attr('href'), title: 'Download this version of this file' })			);		});	}	$(addLinks); })(jQuery, mediaWiki);