User:JJMC89/AjaxPatrolLinks.js

/** * Makes patrol links execute without an additional page load. * @author Krinkle * @documantation http://ddowiki.com/page/User:JJMC89/AjaxPatrolLinks * @source http://ddowiki.com/page/User:JJMC89/AjaxPatrolLinks.js * Note: MediaWiki 1.21 includes this functionality. */ function AjaxPatrolLinks { var $patrollinks = $('.patrollink a'); if ($patrollinks.length > 0) { $patrollinks.click(function (e) {			e.preventDefault;			var href = $(this).attr('href');			$patrollinks.text('Marking as patrolled...');			$patrollinks = $patrollinks.parent;			$.get( href, null, function (data, status, request) { if (status == 'success') { $patrollinks.html(' Marked as patrolled '); } else { $patrollinks.html(' Cannot mark as patrolled '); }				}			);			return false; // Prevent other handlers from firing.		}); } } $(AjaxPatrolLinks);