FANDOM


Languages: English | 中文

ChatReload is a script that refreshes the chat box for a certain time.


importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:ChatReload.js',
    ]
});


Options

Description Type Default Example
window.chatReloadTime Time (in milliseconds) for the chat box to refresh Number greater than or equal to 5000 20000
// Refresh every 10 seconds
window.chatReloadTime = 10000;
 
importArticles({
    type: 'script',
    articles: [
        'u:dev:ChatReload/code.js'
    ]
});


Using configuration options with FANDOM Open Source Library scripts
The instructions on this page describe how to use configuration options with a script. Here on the FANDOM Open Source Library, 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
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');

Updates

15 February 2014
Fixed bug in which chat boxes appear incorrectly on pages with <chat />
26 January 2014
Initial release