Holby Wiki - Casualty and Holby City

Attention Monobook Users
Casualty Wiki has not been coded to fully support Monobook. Some elements of the wiki may not display correctly when using the theme.
It is recommended that you switch to Oasis.

READ MORE

Holby Wiki - Casualty and Holby City
Holby Wiki - Casualty and Holby City
No edit summary
No edit summary
Line 4: Line 4:
   
   
var ajaxPages = 'Special:RecentChanges';
+
ajaxPages = 'Special:RecentChanges';
   
 
/**
 
/**
Line 11: Line 11:
 
function preloadAJAXRL() {
 
function preloadAJAXRL() {
 
$( '#ajaxLoadProgress' ).ajaxComplete ( function ( event, xhr, settings ) {
 
$( '#ajaxLoadProgress' ).ajaxComplete ( function ( event, xhr, settings ) {
$collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' );
+
var $collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' );
 
if ( location.href == settings.url ) {
 
if ( location.href == settings.url ) {
 
$( this ).hide();
 
$( this ).hide();

Revision as of 13:31, 14 August 2012

	ajaxTimer,
	ajaxRefresh = 30000,



	ajaxPages = 'Special:RecentChanges';

/**
 * Main function to start the Auto-refresh process
 */
function preloadAJAXRL() {
	$( '#ajaxLoadProgress' ).ajaxComplete ( function ( event, xhr, settings ) {
		var  $collapsibleElements = $( '#mw-content-text' ).find( '.mw-collapsible' );
		if ( location.href == settings.url ) {
			$( this ).hide();
			for ( var i = 0; i < ajaxCallAgain.length; i++ ) {
				ajaxCallAgain[i]();
			}
			if ( $collapsibleElements.length ) {
				$collapsibleElements.makeCollapsible();
			}
			if ( mw.config.get( 'wgNamespaceNumber' ) === -1 && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ) {
				mw.special.recentchanges.init();
			}
		}
	} );
		loadPageData();
}

/**
 * Does the actual refresh
 */
function loadPageData() {
	var cC = '#mw-content-text';
	$( cC ).load( location.href + " " + cC + " > *", function ( data ) {
		if ( doRefresh ) {
			ajaxTimer = setTimeout( loadPageData, ajaxRefresh );
		}
	} );
}

/**
 * Load the script on specific pages
 */
$( function () {
	for ( var x = 0; x < ajaxPages.length; x++ ) {
		if ( wgPageName == ajaxPages[x] && $( '#ajaxToggle' ).length === 0 ) {
			preloadAJAXRL();
		}
	}
} );