MediaWiki:Common.js

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

/* Fair use rationale */

function preloadUploadDesc { if (wgPageName.toLowerCase != 'special:upload') { return; } document.getElementById('wpUploadDescription').appendChild(document.createTextNode("")); } addOnloadHook (preloadUploadDesc);

AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; ajaxPages = ["Special:RecentChanges","Special:WikiActivity"];

PurgeButtonText = 'Purge';

/* importScriptPages-start */ importArticles({   type: 'script',    articles: [        'MediaWiki:Common.js/Toggler.js',

'u:dev:AjaxBatchDelete/code.2.js', 'u:dev:AjaxRC/code.js', 'u:dev:AllPagesHideRedirect/code.js', 'u:dev:AutoEditDropdown/code.js', 'u:dev:BackToTopButton/code.js', 'u:dev:Countdown/code.js', 'u:dev:ExternalImageLoader/code.js', 'u:dev:ListFiles/code.js', // ListFiles from Dev Wiki 'u:dev:PurgeButton/code.js', 'u:dev:ReferencePopups/code.js', 'u:dev:SignatureCheck/code.js', 'u:dev:ShowHide/code.js', ] }, {   type: 'style', article: 'u:dev:Highlight/code.css' }); /* importScriptPages-end */

/* Replaces with the name of the user browsing the page. Requires copying Template:USERNAME. */

function UserNameReplace { if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName === null) return; $("span.insertusername").html(wgUserName); } addOnloadHook(UserNameReplace);

/* End of the replacement */

// BEGIN JavaScript title rewrite -- jQuery version and new wikia skin fixes by Grunny

function rewriteTitle { if (typeof(window.SKIP_TITLE_REWRITE) != 'undefined' && window.SKIP_TITLE_REWRITE) { return; }

if ($('#title-meta').length === 0) { return; }

var newTitle = $('#title-meta').html; if (skin == "oasis") { $('header.WikiaPageHeader > h1').html(' ' + newTitle + ' '); $('header.WikiaPageHeader > h1').attr('style', 'text-align:' + $('#title-align').html + ';'); } else { $('.firstHeading').html(' ' + newTitle + ' '); $('.firstHeading').attr('style', 'text-align:' + $('#title-align').html + ';'); } }

// END JavaScript title rewrite addOnloadHook(rewriteTitle);

// ============================================================ // displayTimer // ============================================================ var refreshDate; function addDate { var UTCDate = ((new Date).toUTCString).replace("GMT", "(UTC)"); $('#showdate').empty.append(' ' + UTCDate.substring(5) + ' '); window.clearTimeout(refreshDate); refreshDate = window.setTimeout(addDate, 1000); } $(function {   if (skin == 'oasis')         $(' ').appendTo('#GlobalNavigation');    else        $('#p-personal ul').prepend(' ');    addDate;    refreshDate = window.setTimeout(addDate, 1000);    $('#displayTimer').css({'font-size': "12px"}); }); //

/* FileLinksAutoUpdate */ if (wgPageName.indexOf("Special:MovePage/File:") != -1 || (wgCanonicalNamespace == "File" && Storage)) { importScriptPage("FileUsageAuto-update/code.js/min.js", "dev"); }