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)

/* importScriptPages-start */

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

importScriptPage('ExternalImageLoader/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);

/* UserTags from Dev Wikia */ window.UserTagsJS = { modules: {}, tags: { benriya: { u:'Benriya'}, } }; UserTagsJS.modules.inactive = 30; UserTagsJS.modules.newuser = true; UserTagsJS.modules.newuser = { days: 5, // Must have been on the Wiki for 5 days edits: 16, // And have at least 16 edits to remove the tag namespace: [0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] // Edits must be made to content namespaces to count }; UserTagsJS.modules.autoconfirmed = true; UserTagsJS.modules.mwGroups = ['bureaucrat', 'chatmoderator', 'patroller', 'rollback', 'sysop', 'bot', 'bot-global']; UserTagsJS.modules.metafilter = { chatmoderator: ['bureaucrat', 'founder'], rollback: ['bureaucrat', 'founder'], patroller: ['bureaucrat', 'founder'], }; UserTagsJS.modules.custom = { 'Demotivator': ['benriya'], }; importArticle({type:'script', article:'w:c:dev:UserTags/code.js'});

importArticles({   type: 'script',    articles: [        "MediaWiki:Common.js/Toggler.js",        'w:c:dev:UserTags/code.js'    ] });

// ============================================================ // 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"}); }); //

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