MediaWiki:AjaxPatrol/code.js

/** * jQuery Ajax Patrol Links * * @author Grunny * */

function ajaxPatrolLinks { if( !$( '.patrollink' ).length ) { return; }	var ajaxIndicatorThrobber = '';	$( '.patrollink' ).click( function ( e ) {		e.preventDefault;		var	$patrolLink = $( this ).children( 'a' ),			$url = $patrolLink.attr( 'href' );		//$patrolLink.text( 'Marking as patrolled...' );		$patrolLink.html( ajaxIndicatorThrobber );		$.get( $url, function ( data ) { $patrolLink.removeAttr( 'href' ).css( 'color', 'grey' ).text( 'Marked as patrolled' ); } );	} ); }

$( ajaxPatrolLinks );