MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
| Line 16: | Line 16: | ||
$('span.Advisory:last-of-type').find('hr').remove(); | $('span.Advisory:last-of-type').find('hr').remove(); | ||
if ($('table#TravelAdvisory span.Advisory').length == 0) $('table#TravelAdvisory').remove(); | if ($('table#TravelAdvisory span.Advisory').length == 0) $('table#TravelAdvisory').remove(); | ||
/*Partial Hide*/ | |||
$('span.exc').click(function () { | |||
$(this).nextUntil('.exc', '.ex').toggle(); | |||
}) | |||
$('.ex').hide(); | |||
/* Customised sgWiki Theme */ | /* Customised sgWiki Theme */ | ||
/*Christmas*/ | /*Christmas*/ | ||
//$('div#bodyContent').append('<div id="snowflakes"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>'); | //$('div#bodyContent').append('<div id="snowflakes"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>'); | ||
Revision as of 08:12, 7 June 2019
/* 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();
/*Partial Hide*/
$('span.exc').click(function () {
$(this).nextUntil('.exc', '.ex').toggle();
})
$('.ex').hide();
/* Customised sgWiki Theme */
/*Christmas*/
//$('div#bodyContent').append('<div id="snowflakes"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>');