-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChat.js
25 lines (24 loc) · 1.07 KB
/
Chat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var loadedTester = setInterval(function() {
if(typeof mainRoom !== "undefined") {
importScriptPage("MediaWiki:JacobsLadderSuite.js","d97"); // import the API
setTimeout(function() {
importScriptPage("MediaWiki:TitleNotifications.js","d97");
},500);
clearInterval(loadedTester);
}
},100);
// Tiny bit of code to add a second timestamp to incoming messages && inline alerts
function appendTimestamps() {
if(cwmLoaded === true) {
timer = new Date();
hours = timer.getHours() % 12;
if (hours === 0) { hours = 12; }
minutes = timer.getMinutes();
seconds = timer.getSeconds();
if($("#entry-"+JLAPI.mostRecentMessage.cid()).hasClass('inline-alert')) {
$("#entry-"+JLAPI.mostRecentMessage.cid()).append("<span class='time' style='font-weight: initial;'>"+hours+":"+padDigits(minutes,2)+":"+padDigits(seconds,2)+"</span>");
} else {
$("#entry-"+JLAPI.mostRecentMessage.cid()+" > span.time").html(hours+":"+padDigits(minutes,2)+":"+padDigits(seconds,2));
}
}
}