User:Abelmoschus Esculentus/AjaxRollback2.js

// jQuery(document).ready(function ($) {	function SetAjaxRollback {		$('span.mw-rollback-link').click(function(e) { e.preventDefault; var $rblink = $(this); var href = this.getElementsByTagName('a')[0].href; this.innerHTML = '';			var summary = "Reverted edits by $2 (talk) to last version by $1"; $.ajax({				url: href.replace("?", "?summary=" + encodeURIComponent(summary) + "&"),				success: function {					$rblink.text(function (i, val) {return val + '[reverted]';});					loadPageData;				},				error: function {					$rblink.text(function (i, val) {return val + '[rollback failed]';});					loadPageData;				}			}); });	}	mw.loader.using(['mediawiki.util', 'mediawiki.api', 'mediawiki.Title', 'mediawiki.RegExp'], function { SetAjaxRollback; }); }); //