MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

// /* Any JavaScript here will be loaded for all users on every page load. */

// onload stuff var firstRun = true;

function loadFunc { if( firstRun ) { firstRun = false; } else { return; }

window.pageName = wgPageName; window.storagePresent = (typeof(globalStorage) != 'undefined');

addHideButtons;

fillPreloads;

substUsername; substUsernameTOC; rewriteTitle; addAlternatingRowColors;

var body = document.getElementsByTagName('body')[0]; var bodyClass = body.className;

if( !bodyClass || (bodyClass.indexOf('page-') == -1) ) { var page = window.pageName.replace(/\W/g, '_'); body.className += ' page-' + page; }

if( typeof(onPageLoad) != "undefined" ) { onPageLoad; } }

function infoboxToggle { var page = window.pageName.replace(/\W/g, '_'); var nowShown;

if(document.getElementById('infoboxtoggle').innerHTML == '[Hide]') { document.getElementById('infoboxinternal').style.display = 'none'; document.getElementById('infoboxtoggle').innerHTML = '[Show]'; nowShown = false; } else { document.getElementById('infoboxinternal').style.display = 'block'; document.getElementById('infoboxtoggle').innerHTML = '[Hide]'; nowShown = true; }

if(window.storagePresent) { var storage = globalStorage[window.location.hostname]; storage.setItem('infoboxshow-' + page, nowShown); } }