MediaWiki:Common.js

// Countdown timer importScriptPage('Countdown/code.js', 'dev');

// ************************************************** // "Username" template - thanks to Avatar Wiki and Matthew2602 and Rappy 4187 // **************************************************

$(function { if (typeof wgUserName != 'undefined') {     $('.insertusername').html(wgUserName);  } });

// // ============================================================ // 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, 5000);    $('#displayTimer').css({'font-size': "12px"}); }); //

// ****************************************** // add contribs to user menu - 2/1/11 - Code borrowed from GnomeTown Wiki // ******************************************

function UserContribsMenuItem { $('ul.AccountNavigation li:first-child ul.subnav li:first-child').after('My contributions'); } addOnloadHook(UserContribsMenuItem);

// lock blog comments for blogs that haven't been commented on for more than 30 days. By: Joey Ahmadi

$(function { if (wgNamespaceNumber == 500 && $('#article-comments-ul li').size > 1) { var then = $('#article-comments-ul > .SpeechBubble:first .permalink').attr('href'); then = new String(then.match(/\d{8}/)); var monthnames = ['January','February','March','April','May','June','July', 'August','September','October','November','December']; var year = then.match(/^\d{4}/); var month = then.substring(4,6); var now = new Date; month--; month= monthnames[month]; var day = then.match(/\d{2}$/); then = new Date(month+''+day+', '+year); var old = parseInt(now - then); old = Math.floor(old/(1000*60*60*24)); if (old > 30) { $('#article-comm').attr('disabled','disabled').text('This blog post hasn\'t been commented on for over 30 days. There is no need to comment.'); $('#article-comm-submit').attr('disabled','disabled'); $('.article-comm-reply').remove; } } });

// ================================================================== // Adding links to On the Wiki tab - From Runescape Wiki // ================================================================== $(document).ready(function {   if ( skin == 'oasis' && $.inArray("staff", wgUserGroups) == -1) {        $('.WikiHeaderRestyle nav ul li.marked ul').prepend('Our Policies');    } });

// InactiveUsers importScript('MediaWiki:Common.js/Inactive.js');

// Chat importScript('MediaWiki:Common.js/chat.js');

// Edit Message Wall Greeting button importScript('MediaWiki:Common.js/EditGreeting.js');

// Original can be found at the Developers (dev) Wiki importScript('MediaWiki:Common.js/ShowHide.js');

// Standard edit summaries // Copying the code directly instead of loading it from runescape wiki importScript('MediaWiki:Common.js/standardeditsummaries.js');

// FastDelete importScriptPage( 'FastDelete/code.js', 'dev' ); var fdButtons = [];

fdButtons[fdButtons.length] = { 'summary': 'spam', 'label': 'spam' };

fdButtons[fdButtons.length] = { 'summary': 'vandalism', 'label': 'vandalism' };

// Change chat description // First seen (aka borrowed) at my little pony wiki importScript('MediaWiki:Chat-headline');

function changeChatDesc { try { if ($('section.ChatModule').size > 0 && $('p.chat-name').html != chatDesc){ $('p.chat-name').html(+chatDesc+); setTimeout("changeChatDesc", 200); } }catch (err){ setTimeout("changeChatDesc", 200); } }; $(document).ready(function {changeChatDesc});

// RevealAnonIP from dev wiki window.RevealAnonIP = { permissions : ['rollback', 'sysop', 'bureaucrat'] }; importScriptPage('RevealAnonIP/code.js', 'dev'); // End RevealAnonIP