Fandom Developers Wiki
Advertisement

AjaxRC is a script for advanced auto refreshing recent changes and watchlist. This is based on the original script from WoWWiki.

Installation

What it does

  • The code adds a checkbox at the top of Special:RecentChanges next to the header.
  • Ticking this sets a cookie (specific to each wiki) and starts updating the list.
  • This occurs silently every 60 seconds without a full page reload occurring.

Configuration

JS

There are several configuration options:

Option Location Description Default
Ajax pages window.ajaxPages Pages that are automatically refreshed []
Ajax special pages window.ajaxSpecialPages Special pages that are automatically refreshed (language-neutral) ['Recentchanges']
Indicator icon window.ajaxIndicator Progress indicator ajax.gif
Refresh time window.ajaxRefresh Interval in which the page is automatically refreshed 60000 (60 seconds)
Display text window.AjaxRCRefreshText Text displayed beside the checkbox on the page "AJAX"
Hover text window.AjaxRCRefreshHoverText Text displayed when hovering over "AJAX" "Enable page auto-refresh"

If you have functions that modify the content that's reloaded, they won't work after the first refresh unless you run them again after the content has loaded. You can do this by adding them to the ajaxCallAgain variable, like this:

window.ajaxCallAgain = window.ajaxCallAgain || [];
window.ajaxCallAgain.push(function1, function2, function3);

Example Configuration

window.ajaxPages = ["Some Frequently Updated Page"];
window.ajaxSpecialPages = ["Recentchanges", "WikiActivity", "Watchlist", "Log", "Contributions"];
window.ajaxIndicator = 'https://images.wikia.nocookie.net/software/images/a/a9/Indicator.gif';
window.ajaxRefresh = 30000;
window.AjaxRCRefreshText = 'Auto-refresh';
window.AjaxRCRefreshHoverText = 'Automatically refresh the page';

Using configuration options with Fandom Developers Wiki scripts

The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.

Configuration options load too late, don't work
// 1. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;

// 2. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

See also

Text above can be found here (edit)
Advertisement