User:Ozuzanna/chattimestamps.js

/*
 * Chat Timestamps
 * @description Create/refine timestamps for each message or alert in chat to be in the format of HH:MM:SS
 * @author Ozuzanna

setTimeout(function {	var object,	time,	seconds,	minutes,	hours;

mw.util.addCSS('.custom-time { font-weight:normal; color: #9C9C9C; float: right; font-size: 12px;}');

mainRoom.model.chats.bind("afteradd", function (child) {		object = $('#entry-' + child.cid);		time = new Date;		hours = time.getHours;		minutes = time.getMinutes;		seconds = time.getSeconds;		if (hours > 12)			hours-= 12;		if (minutes < 10)			minutes = "0" + minutes;		if (seconds < 10)			seconds = "0" + seconds;		if (object.children('.time').length)			object.children('.time').remove;		object.append(' ' + hours + ':' + minutes + ':' + seconds + ' ');			}); }, 10000);