MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ // ============================================================ // 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"}); }); //

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

/* Countdown */ $(function{	importArticles({ type: "script", articles: ["u:zh.pad.wikia.com:MediaWiki:CountDown.js"] }, {		type: "style", articles: ["u:zh.pad.wikia.com:MediaWiki:CountDown.css"] }); });

/* Imports */ importArticles({   type: "script",    articles: [        // Countdown long dates        "w:c:dev:Countdown/code.js",        // Back to top button        "w:c:dev:BackToTopButton/code.js",        // Adds Purge Button in Dropdown of Edit Button        "w:c:dev:NullEditButton/code.js",        // Adds a Button to add a Message Wall Greeting        "w:dev:WallGreetingButton/code.js"    ] });

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

// Skin Switch Button for monobook to oasis and vice versa // and for monobook and oasis to wikiamobile $( function {	if ( !document.getElementById( 'ca-skins' ) ) {		if ( skin === 'oasis' || skin === 'wikia' ) {			$( 'MB' ).appendTo( '#AccountNavigation' ); $( 'WM' ).appendTo( '#AccountNavigation' );		} else {			$( 'Oasis</a></li>' ).appendTo( '#p-cactions > .pBody > ul' ); $( '<a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">Mobile</a></li>' ).appendTo( '#p-cactions > .pBody > ul' );		} 	} } );

/* Adds cancel button above edit screen */ importScriptPage('MediaWiki:Wikia.js/cancelButton.js', 'admintools');

// Adding "My Contributions" to user menu. // Function: Adds "My Contributions" to the UserDropdownMenu. function UserContribsMenuItem { $('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('<a href="/wiki/Special:Contributions/'+ encodeURIComponent (wgUserName) +'">My Contributions</a></li>'); } addOnloadHook(UserContribsMenuItem); function onloadhookcustom { var replace = document.getElementById("OnlineChat"); if (null != replace) { var getvalue = replace.getAttribute("class"); } }

//Message Wall Posts Tags var messageWallUserTags = { 'Re_coded_NL': 'Admin', '2Actimv': 'Admin' }; window.messageWallTagColor = '#034001'; var messageWallTagColor = window.messageWallTagColor || '#034001'; (function($) {   for (var name in messageWallUserTags) {        $('a.subtle[href$="Message_Wall:' + name + '"]').after('<span style="color:' + messageWallTagColor + ';margin-left:-2px;font-size:10px;vertical-align:top;">(' + messageWallUserTags[name] + ') ');    } }(jQuery)); //

/* Wiki Notification */ function addPageBottom { $("#WikiaRail").append('<div class="Actimv" style="position:fixed; bottom:2.5em; right:0.5em; z-index:999; width:130px; border-radius: 4px; box-shadow: 0px 0px 5px black; background-color: #0FB200; text-align:left; padding:10px; font-family: standard; font-size: 118%; color: white;"><a href="/wiki/2014 FIFA World Cup" style="color: yellow;">The 2014 FIFA World Cup</a> is this year! <a href="/wiki/User_blog:2Actimv/2014_FIFA_World_Cup:_An_Introduction_and_Analyse_of_the_Teams" style="color: yellow;">Want to learn more about it?</a> '); } $(addPageBottom);

var newElement = [ ' ', '  <a href="http://the-football-database.wikia.com/wiki/Features_Center">Features Center</a> ', '  <div style="margin-top: -16px; padding: 0; width: 100%; background-image: url(http://images.wikia.com/the-football-database/images/4/45/Dark_green_grass_texture-other.jpg);">', '        <tr style="line-height: 15px; text-align: center; font-size: 14px;">', '           ', '                 There are several features on the wiki. There is a <a href="http://the-football-database.wikia.com/wiki/Match_Center">Match Center</a> to see upcoming matches. But there is also a <a href="http://the-football-database.wikia.com/wiki/News">News</a> page. Click <a href="http://the-football-database.wikia.com/wiki/Features_Center">here</a> to see all features.

Do you know a wiki or do you have a wiki about soccer? Take part in <a href="http://the-football-database.wikia.com/wiki/Soccer_Wikis_Support">Soccer Wikis Support</a>. ', '           ', '         ', '   ', ' ' ].join(''); $('#WikiaRail').append(newElement);

importArticles({   type: "script",    articles: [        // Countdown long dates        "w:c:the-football-database:MediaWiki:Chat.js",    ] });