MediaWiki:Common.js

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

var d = new Date; var hour = d.getHours; if (hour <= 4) { d.setTime(d.getTime - 7200000); }

var x = ('00' + d.getDate).substr(-2) + ('00' + (d.getMonth + 1)).substr(-2) + ('00' + d.getFullYear).substr(-2);

$('span.Advisory,td.Advisory,th.Advisory').each(function {	if (!$(this).hasClass(x)) {		if (($(this).hasClass('train') || $(this).hasClass('event')) && !$(this).hasClass('not')) $(this).remove;	} else {		if (($(this).hasClass('train') || $(this).hasClass('event')) && $(this).hasClass('not')) $(this).remove;	}; }) $('span.Advisory:last-of-type').find('hr').remove; if ($('table#TravelAdvisory span.Advisory').length == 0) $('table#TravelAdvisory').remove; $('table#TravelAdvisory u>span').html(' (' + d.getDate + '/' + (d.getMonth + 1) + '/' + d.getFullYear + ')');

/* Custom Auto Redirect */ if ($('#mw-content-text span.redirect').length == 1 && $('table.diff').length == 0) setTimeout(function { location.href = $('#mw-content-text span.redirect a').attr('href'); }, 5000); //auto-redirect in 5s

/* Infobox */ if ($('.infobox tr:first-of-type img').length == 0) $('.infobox .img-alt').remove;

/*Partial Hide*/ $('.exc').on('click', function { $(this).nextUntil('.exc').find('.ex').toggle; }) $('.ex').hide;

/* Customised sgWiki Theme */ /*Christmas if (d.getMinutes >= 0 && d.getMinutes <= 10) $('div#bodyContent').append('  ');*/