MediaWiki:Gadget-ajaxpatrol.js
From Wario Speedrunning Wiki
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/** * 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 ); });