mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 01:23:38 +02:00
Fix time and date formatting.
This commit is contained in:
parent
394c9e2175
commit
dc5418748d
3 changed files with 16 additions and 6 deletions
|
@ -323,7 +323,7 @@
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function logMessage(userName, message, logScreen, colour) {
|
function logMessage(timestamp, userName, message, logScreen, colour) {
|
||||||
var LogScreen = $("#" + logScreen);
|
var LogScreen = $("#" + logScreen);
|
||||||
var $logLine =
|
var $logLine =
|
||||||
$('<div/>')
|
$('<div/>')
|
||||||
|
@ -334,6 +334,10 @@
|
||||||
.addClass('z-depth-2')
|
.addClass('z-depth-2')
|
||||||
.data('chat-message', message).css("color", rgbToHex(colour))
|
.data('chat-message', message).css("color", rgbToHex(colour))
|
||||||
.appendTo(LogScreen);
|
.appendTo(LogScreen);
|
||||||
|
$('<span/>')
|
||||||
|
.addClass('LogLogLineTimestamp')
|
||||||
|
.text(timestamp).css("color", rgbToHex(colour))
|
||||||
|
.appendTo($logLine);
|
||||||
$('<b/>')
|
$('<b/>')
|
||||||
.addClass('LogLogLineMessage')
|
.addClass('LogLogLineMessage')
|
||||||
.text(userName + ": ").css("color", rgbToHex(colour))
|
.text(userName + ": ").css("color", rgbToHex(colour))
|
||||||
|
@ -431,11 +435,11 @@
|
||||||
var temp = cmd.data;
|
var temp = cmd.data;
|
||||||
if (temp.length === 1) {
|
if (temp.length === 1) {
|
||||||
var temp2 = temp[0];
|
var temp2 = temp[0];
|
||||||
logMessage("[" + temp2[0] + "] " + temp2[2], temp2[1], temp2[4], temp2[3]);
|
logMessage("[" + temp2[0] + "] ", temp2[2], temp2[1], temp2[4], temp2[3]);
|
||||||
scrollChatLog(temp2[4]);
|
scrollChatLog(temp2[4]);
|
||||||
} else if (temp.length > 1) {
|
} else if (temp.length > 1) {
|
||||||
temp.forEach(function (msg) {
|
temp.forEach(function (msg) {
|
||||||
logMessage("[" + msg[0] + "] " + msg[2], msg[1], msg[4], msg[3]);
|
logMessage("[" + msg[0] + "] ", msg[2], msg[1], msg[4], msg[3]);
|
||||||
scrollChatLog(msg[4]);
|
scrollChatLog(msg[4]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -476,12 +476,13 @@ function time() {
|
||||||
var m2 = ("0" + m).slice(-2);
|
var m2 = ("0" + m).slice(-2);
|
||||||
var s2 = ("0" + s).slice(-2);
|
var s2 = ("0" + s).slice(-2);
|
||||||
// s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1);
|
// s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1);
|
||||||
return month + "/" + day + "-" + h2 + ":" + m2 + ":" + s2;
|
return month + "/" + day + " - " + h2 + ":" + m2 + ":" + s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToLog(msg, dp, colour, tab) {
|
function addToLog(msg, dp, colour, tab) {
|
||||||
historyLog.push([time(), msg, dp, colour, tab]);
|
var currentTimestamp = time();
|
||||||
chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: [[time(), msg, dp, colour, tab]]}));
|
historyLog.push([currentTimestamp, msg, dp, colour, tab]);
|
||||||
|
chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: [[currentTimestamp, msg, dp, colour, tab]]}));
|
||||||
while (historyLog.length > chatHistoryLimit) {
|
while (historyLog.length > chatHistoryLimit) {
|
||||||
historyLog.shift();
|
historyLog.shift();
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,11 @@ body {
|
||||||
/*font-style: italic;*/
|
/*font-style: italic;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.LogLogLineTimestamp {
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.ChatInput {
|
.ChatInput {
|
||||||
color: #252525;
|
color: #252525;
|
||||||
background: #252525;
|
background: #252525;
|
||||||
|
|
Loading…
Reference in a new issue