MediaWiki:Gadget-ajaxpatrol.js: Difference between revisions
From Wario Speedrunning Wiki
C&P from User:Skizzerz/Scripts/AjaxPatrol.js |
Trig Jegman (talk | contribs) m 1 revision imported |
||
(No difference)
| |||
Latest revision as of 15:53, 30 April 2025
/**
* AJAX patrol feature version 3.0
* by Ryan Schmidt < http://strategywiki.org/wiki/User:Ryan_Schmidt >
*/
/*
* CONFIGURATION
* You may set whether or not to automatically browse to the next diff
* by inserting the following into your user js page.
* var AjaxPatrolAutoNext = true; (default true)
*/
function AjaxPatrol(autoNext) {
$('.patrollink a').click(function() {
var origtitle = document.title;
var parent = $(this).parent();
$.get($(this).attr('href'), function() {
document.title = origtitle;
if (autoNext && $('#differences-nextlink').length > 0) {
parent.text('[Done. Loading next diff]');
window.location = $('#differences-nextlink').attr('href');
} else {
parent.text('[Done. You may now browse away from the page]');
}
});
document.title = '(' + origtitle + ')';
parent.text('[Patrolling edit...]');
return false;
});
}
// set it to run on load
$(function() {
if( typeof AjaxPatrolAutoNext == 'undefined' ) {
AjaxPatrolAutoNext = true;
}
new AjaxPatrol( AjaxPatrolAutoNext );
});

