User:Sonicwave/common.js

// Courtesy of https://terraria.gamepedia.com/MediaWiki:Gadget-utcClock.js

var lang = function ( message ) { return "Click to purge cache for current page"; }

var linkPurge = mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( mw.config.get( 'wgPageName' ) ) + '&action=purge';

var clockStyle = 'font-weight:bolder; color:#fff; font-size:150%;';

window.showTime = function { var now = new Date; var hh = now.getUTCHours; var mm = now.getUTCMinutes; var ss = now.getUTCSeconds; var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss ); $('.dateNode').text( time ); var ms = now.getUTCMilliseconds; setTimeout( function {		showTime;	}, 1100 - ms ); }

$(function {	$('.netbar-box.right:first').before('  ');	showTime; });

// https://terraria.gamepedia.com/MediaWiki:Gadget-redirect-modifier.js

$(function {	$("a,a *").click(function(event) { if (!event.altKey) return; h = $(event.target).attr("href"); if (h.indexOf("?")==-1) h+="?redirect=no"; else h+= "&redirect=no"; $(event.target).attr("href", h); location.href = h;	}); });