MediaWiki:Gadget-recentEditLinks.js

// By Equazcion: http://terraria.gamepedia.com/User:Equazcion

var l10n = (function{	var $text = {		'undoLinktext': {			'en': 'undo',			'de': 'rückgängig machen',			'fr': 'annuler',		},		'undoHovertext': {			'en': 'Undo this edit',			'de': 'Diese Bearbeitung rückgängig machen',			'fr': 'Annuler cette modification',		},		'editLinktext': {			'en': 'edit',			'de': 'bearbeiten',			'fr': 'modifier',		},		'editHovertext': {			'en': 'Edit ',			'de': 'Bearbeiten: ',			'fr': 'Modifier ',		}	}	var $lang = mw.config.get( 'wgUserLanguage' ) || 'en';	return function(key){		return $text[key] && ($text[key][$lang] || $text[key]['en']) || '';	} });

var editLinkPre = mw.config.get('wgServer') + '/index.php?title=';

$('li[class^="mw-line"] a[href$="&action=history"]').each(function{	var $this = $(this);	var receditTitle = $this.siblings('.mw-title').find('a.mw-changeslist-title').attr('title');	if ($this.siblings('abbr.newpage').length < 1){		var receditDiff = $this.siblings('a[href*="&diff="]').attr('href');		var receditUndo = receditDiff			.replace(/&curid=.*?&/, '&')			.replace(/&diff=/, '&undo=')			.replace(/&oldid=/, '&undoafter=');		var receditUndoLink = '' + l10n('undoLinktext') + '';	}	var receditEditLink = '' + l10n('editLinktext') + '';	$this.after(' | ' + (($this.siblings('abbr.newpage').length < 1) ? receditUndoLink + ' | ' : '') + receditEditLink); });