MediaWiki:Common.js

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

/* importScriptPages-start */

PurgeButtonText = 'Purge'; importScriptPage('PurgeButton/code.js', 'dev');

importScriptPage('ReferencePopups/code.js', 'dev'); importScriptPage('Countdown/code.js', 'dev'); importScriptPage('AutoEditDropdown/code.js', 'dev'); importScriptPage('OasisToolbarButtons/code.js', 'dev'); importScriptPage('BackToTopButton/code.js', 'dev'); importScriptPage('PortableCSSPad/code.js', 'dev'); importScriptPage('SexyUserPage/code.js', 'dev'); importScriptPage('SignatureCheck/code.js', 'dev'); importScriptPage('AllPagesHideRedirect/code.js', 'dev'); importScriptPage('Highlight/code.css', 'dev'); importScriptPage('Countdown/code.js', 'dev'); importScriptPage('ShowHide/code.js', 'dev');

/* importScriptPages-end */

AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; ajaxPages = ["Special:RecentChanges","Special:WikiActivity"]; importScriptPage('AjaxRC/code.js', 'dev');

/* 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); } $(document).ready(function {   if (skin == 'oasis')         $(' ').appendTo('#GlobalNavigation');    else        $('#p-personal ul').prepend(' ');    addDate;    refreshDate = window.setTimeout(addDate, 1000);    $('#displayTimer').css({'font-size': "12px"}); }); //

importArticles({   type: 'script',    articles: [        'u:dev:FloatingToc/code.js'    ] });