Wikia

Wikia Developers Wiki

AjaxRC

Talk143
660pages on
this wiki
AjaxRC
AjaxRC
TypeJavaScript
DescriptionAdvanced auto refreshing recent changes and watchlist
ScopeFor site-wide use
For personal use
Author(s)pcj
Grunny
Kangaroopower
Updated18 April 2013
Code/code.js
SkinsMonobook
Oasis
LanguagesEnglish

AjaxRC is a script for advanced auto refreshing recent changes and watchlist. This is a modified version of the WoWWiki script.

Usage

If you would like to use the script, simply add the following to your wiki's MediaWiki:Common.js (for wiki-wide use), w:Special:MyPage/global.js (for personal use on all Wikia-hosted wikis) or Special:MyPage/monobook.js/Special:MyPage/wikia.js on a specific wiki:

importScriptPage('AjaxRC/code.js', 'dev');

What it does

  • The code adds a checkbox at the top of Special:RecentChanges and Special:Watchlist, 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.

Options

You can change some settings in your JavaScript by adding some/all of the following.

  • The effect can be applied to other pages by adding above the import line code similar to:
window.ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"];
importScriptPage('AjaxRC/code.js', 'dev');
  • An alternate progress indicator can be declared below the import line as such:
window.ajaxIndicator = 'http://images2.wikia.nocookie.net/__cb20100609110347/software/images/a/a9/Indicator.gif';
importScriptPage('AjaxRC/code.js', 'dev');
  • The refresh time can be changed by adding (this changes time to 30 seconds):
window.ajaxRefresh = 30000;
importScriptPage('AjaxRC/code.js', 'dev');
  • To change the text of the "AJAX" or the hover information, set AjaxRCRefreshText and AjaxRCRefreshHoverText before the import, like this
window.AjaxRCRefreshText = 'Auto-refresh';
window.AjaxRCRefreshHoverText = 'Automatically refresh the page';
importScriptPage('AjaxRC/code.js', 'dev');
  • 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);
importScriptPage('AjaxRC/code.js', 'dev');
Using configuration options with Wikia Developer's Wiki scripts
The instructions on this page describe how to use configuration options with a script. Here on the Wikia Developer's 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.
Configuration options load too late, don't work
Proper placement of configuration options
// 1. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');
 
// 2. AjaxRC configuration option
var ajaxRefresh = 30000;
// 1. AjaxRC configuration option
var ajaxRefresh = 30000;
 
// 2. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');

See also

Around Wikia's network

Random Wiki