mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 16:43:33 +02:00
Merge pull request #485 from kasenvr/fix/chat-optimizations
Fix/chat optimizations
This commit is contained in:
commit
fb1b1aaa50
10 changed files with 188 additions and 48 deletions
|
@ -12,6 +12,7 @@
|
|||
<link type="text/css" rel="stylesheet" href="css/FloofChat.css" media="screen,projection"/>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600,700" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400&display=swap" rel="stylesheet">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
@ -28,11 +29,19 @@
|
|||
</span>
|
||||
<div class="switch muteSwitch col s2">
|
||||
<label>
|
||||
<span style="font-size: 20px" id="muteText">Mute</span>
|
||||
<span id="muteText">Hide Popups</span>
|
||||
<input type="checkbox" id="muteInput" onclick="muteSwitchToggle()">
|
||||
<span class="lever waves-light"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="switch muteSwitch col s2">
|
||||
<label>
|
||||
<span id="muteAudioText">Mute Sound</span>
|
||||
<input type="checkbox" id="muteAudioInput" onclick="muteAudioSwitchToggle()">
|
||||
<span class="lever waves-light"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<span class="col s1">
|
||||
</span>
|
||||
|
@ -46,6 +55,7 @@
|
|||
|
||||
<script>
|
||||
var muted = {"Local": false, "Domain": false, "Grid": false};
|
||||
var mutedAudio = {"Local": false, "Domain": false, "Grid": false};
|
||||
var instance;
|
||||
var appUUID;
|
||||
var messageData = {}; // The data that is sent along with the message.
|
||||
|
@ -171,13 +181,23 @@
|
|||
case ext == "JPG":
|
||||
case ext == "GIF":
|
||||
case ext == "JPEG":
|
||||
elContent = elContent.replace(this, "<br/><img src='" + this + "'class=\"responsive z-depth-2\"><br/><a href=\"javascript:gotoClipboard('" + this + "');\" target='_blank'>" + this + "</a>");
|
||||
elContent = elContent.replace(this, "<br/><img src='" + this
|
||||
+ "'class=\"responsive z-depth-2\"><br/><a href=\"javascript:gotoClipboard('" + this + "');\" target='_blank'>" + this
|
||||
+ "</a><a onclick=\"gotoExternalURL('" + this
|
||||
+ "');return false;\"href=\"" + this
|
||||
+ "\">📲</a>");
|
||||
break;
|
||||
case ext == "iframe":
|
||||
elContent = elContent.replace(this, "<br/><iframe class=\"z-depth-2\" src='" + this + "'width=\"440\" height=\"248\" frameborder=\"0\"></iframe>");
|
||||
elContent = elContent.replace(this, "<br/><iframe class=\"z-depth-2\" src='" + this
|
||||
+ "'width=\"440\" height=\"248\" frameborder=\"0\"></iframe>");
|
||||
break;
|
||||
case ext == "webm":
|
||||
elContent = elContent.replace(this, "<br/><video controls class=\"z-depth-2 responsive\"><source src='" + this + "' type='video/" + ext + "'></video><br/><a href=\"javascript:gotoClipboard('" + this + "');\">" + this + "</a>");
|
||||
elContent = elContent.replace(this, "<br/><video controls class=\"z-depth-2 responsive\"><source src='" + this
|
||||
+ "' type='video/" + ext + "'></video><br/><a href=\"javascript:gotoClipboard('" + this
|
||||
+ "');\">" + this
|
||||
+ "</a><a onclick=\"gotoExternalURL('" + this
|
||||
+ "');return false;\"href=\"" + this
|
||||
+ "\">📲</a>");
|
||||
break;
|
||||
case protocol === "HIFI":
|
||||
case protocol === "hifi":
|
||||
|
@ -186,13 +206,24 @@
|
|||
case !!this.match(/(https?:\/\/)?(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([^& \n<]+)(?:[^ \n<]+)?/g):
|
||||
var youtubeMatch = this.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);
|
||||
if (youtubeMatch && youtubeMatch[2].length == 11) {
|
||||
elContent = "<br/><iframe class=\"z-depth-2\" width='420' height='236' src='https://www.youtube.com/embed/" + youtubeMatch[2] + "' frameborder='0'></iframe><br/><a href=\"javascript:gotoURL('" + this + "');\">" + this + "</a>";
|
||||
elContent = "<br/><iframe class=\"z-depth-2\" width='420' height='236' src='https://www.youtube.com/embed/" + youtubeMatch[2]
|
||||
+ "' frameborder='0'></iframe><br/><a href=\"javascript:gotoURL('" + this
|
||||
+ "');\">" + this
|
||||
+ "</a><a onclick=\"gotoExternalURL('" + this
|
||||
+ "');return false;\"href=\"" + this
|
||||
+ "\">📲</a>";
|
||||
break;
|
||||
}
|
||||
// else fall through to default
|
||||
default:
|
||||
elContent = elContent.replace(this, "<br/><a href=\"javascript:gotoURL('" + this + "');\">" + this + "</a>");
|
||||
elContent = elContent.replace(this, "<br/><a onclick=\"gotoURL('" + this
|
||||
+ "');return false;\" href=\"" + this
|
||||
+ "\">" + this
|
||||
+ "</a><a onclick=\"gotoExternalURL('" + this
|
||||
+ "');return false;\"href=\"" + this
|
||||
+ "\">📲</a>");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -284,6 +315,10 @@
|
|||
function gotoURL(url) {
|
||||
emitWebEvent({type: "CMD", cmd: "URL", url: url});
|
||||
}
|
||||
|
||||
function gotoExternalURL(url) {
|
||||
emitWebEvent({ type: "CMD", cmd: "EXTERNALURL", url: url });
|
||||
}
|
||||
|
||||
function gotoClipboard(url) {
|
||||
M.toast({html: 'Copied URL to Clipboard', classes: 'rounded pink white-text'});
|
||||
|
@ -322,7 +357,7 @@
|
|||
location.reload();
|
||||
}
|
||||
|
||||
function logMessage(userName, message, logScreen, colour) {
|
||||
function logMessage(timestamp, userName, message, logScreen, colour) {
|
||||
var LogScreen = $("#" + logScreen);
|
||||
var $logLine =
|
||||
$('<div/>')
|
||||
|
@ -333,6 +368,10 @@
|
|||
.addClass('z-depth-2')
|
||||
.data('chat-message', message).css("color", rgbToHex(colour))
|
||||
.appendTo(LogScreen);
|
||||
$('<span/>')
|
||||
.addClass('LogLogLineTimestamp')
|
||||
.text(timestamp).css("color", rgbToHex(colour))
|
||||
.appendTo($logLine);
|
||||
$('<b/>')
|
||||
.addClass('LogLogLineMessage')
|
||||
.text(userName + ": ").css("color", rgbToHex(colour))
|
||||
|
@ -350,18 +389,23 @@
|
|||
|
||||
function time() {
|
||||
var d = new Date();
|
||||
var month = (d.getMonth()).toString();
|
||||
var day = (d.getDate()).toString();
|
||||
var h = (d.getHours()).toString();
|
||||
var m = (d.getMinutes()).toString();
|
||||
var s = (d.getSeconds()).toString();
|
||||
var h2 = ("0" + h).slice(-2);
|
||||
var m2 = ("0" + m).slice(-2);
|
||||
var s2 = ("0" + s).slice(-2);
|
||||
s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1);
|
||||
return h2 + ":" + m2 + ":" + s2;
|
||||
// s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1);
|
||||
return month + "/" + day + " - " + h2 + ":" + m2 + ":" + s2;
|
||||
}
|
||||
|
||||
var muteInput;
|
||||
var muteText;
|
||||
|
||||
var muteAudioInput;
|
||||
var muteAudioText;
|
||||
|
||||
function muteSwitchToggle() {
|
||||
muted[getCurrTab()] = muteInput.checked;
|
||||
|
@ -369,18 +413,33 @@
|
|||
muteText.classList.remove(!muteInput.checked ? "red-text" : "white-text");
|
||||
emitWebEvent({type: "CMD", cmd: "MUTED", muted: muted});
|
||||
}
|
||||
|
||||
function muteAudioSwitchToggle() {
|
||||
mutedAudio[getCurrTab()] = muteAudioInput.checked;
|
||||
muteAudioText.classList.add(muteAudioInput.checked ? "red-text" : "white-text");
|
||||
muteAudioText.classList.remove(!muteAudioInput.checked ? "red-text" : "white-text");
|
||||
emitWebEvent({ type: "CMD", cmd: "MUTEDAUDIO", muted: mutedAudio });
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
muteInput = document.getElementById("muteInput");
|
||||
muteText = document.getElementById("muteText");
|
||||
|
||||
muteAudioInput = document.getElementById("muteAudioInput");
|
||||
muteAudioText = document.getElementById("muteAudioText");
|
||||
|
||||
instance = M.Tabs.init(document.getElementById("tabs"), {
|
||||
"onShow": function (e) {
|
||||
scrollChatLog(getCurrTab());
|
||||
|
||||
muteInput.checked = muted[getCurrTab()];
|
||||
muteText.classList.add(muteInput.checked ? "red-text" : "white-text");
|
||||
muteText.classList.remove(!muteInput.checked ? "red-text" : "white-text");
|
||||
|
||||
muteAudioInput.checked = mutedAudio[getCurrTab()];
|
||||
muteAudioText.classList.add(muteAudioInput.checked ? "red-text" : "white-text");
|
||||
muteAudioText.classList.remove(!muteAudioInput.checked ? "red-text" : "white-text");
|
||||
}
|
||||
});
|
||||
instance.select("Local");
|
||||
|
@ -430,11 +489,11 @@
|
|||
var temp = cmd.data;
|
||||
if (temp.length === 1) {
|
||||
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]);
|
||||
} else if (temp.length > 1) {
|
||||
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]);
|
||||
});
|
||||
}
|
||||
|
@ -445,6 +504,12 @@
|
|||
muteText.classList.add(muteInput.checked ? "red-text" : "white-text");
|
||||
muteText.classList.remove(!muteInput.checked ? "red-text" : "white-text");
|
||||
}
|
||||
if (cmd.cmd === "MUTEDAUDIO") {
|
||||
mutedAudio = cmd.muted;
|
||||
muteAudioInput.checked = mutedAudio[getCurrTab()];
|
||||
muteAudioText.classList.add(muteAudioInput.checked ? "red-text" : "white-text");
|
||||
muteAudioText.classList.remove(!muteAudioInput.checked ? "red-text" : "white-text");
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 100); // Delay to allow everything to settle
|
|
@ -23,6 +23,12 @@ var SHIFT_KEY = 33554432;
|
|||
var FLOOF_CHAT_CHANNEL = "Chat";
|
||||
var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif";
|
||||
|
||||
var MAIN_CHAT_WINDOW_HEIGHT = 450;
|
||||
var MAIN_CHAT_WINDOW_WIDTH = 750;
|
||||
|
||||
var CHAT_BAR_HISTORY_LIMIT = 256;
|
||||
var CHAT_HISTORY_LIMIT = 500;
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
shutdown();
|
||||
});
|
||||
|
@ -41,8 +47,8 @@ var appUUID = Uuid.generate();
|
|||
|
||||
var chatBar;
|
||||
var chatHistory;
|
||||
var chatBarHistoryLimit = Settings.getValue(settingsRoot + "/chatBarHistoryLimit", 256);
|
||||
var chatHistoryLimit = Settings.getValue(settingsRoot + "/chatHistoryLimit", 500);
|
||||
var chatBarHistoryLimit = Settings.getValue(settingsRoot + "/chatBarHistoryLimit", CHAT_BAR_HISTORY_LIMIT);
|
||||
var chatHistoryLimit = Settings.getValue(settingsRoot + "/chatHistoryLimit", CHAT_HISTORY_LIMIT);
|
||||
var chatBarHistory = Settings.getValue(settingsRoot + "/chatBarHistory", ["Meow :3"]);
|
||||
var historyLog = [];
|
||||
|
||||
|
@ -50,14 +56,16 @@ var visible = false;
|
|||
var historyVisible = false;
|
||||
var settingsRoot = "FloofChat";
|
||||
|
||||
var athenaGotoUrl = "https://metaverse.projectathena.io/interim/d-goto/app/goto.json";
|
||||
var gotoJSONUrl = Settings.getValue(settingsRoot + "/gotoJSONUrl", athenaGotoUrl);
|
||||
var vircadiaGotoUrl = "https://metaverse.vircadia.com/interim/d-goto/app/goto.json";
|
||||
var gotoJSONUrl = Settings.getValue(settingsRoot + "/gotoJSONUrl", vircadiaGotoUrl);
|
||||
|
||||
var muted = Settings.getValue(settingsRoot + "/muted", {"Local": false, "Domain": false, "Grid": true});
|
||||
var mutedAudio = Settings.getValue(settingsRoot + "/mutedAudio", {"Local": false, "Domain": false, "Grid": true});
|
||||
var notificationSound = SoundCache.getSound(Script.resolvePath("resources/bubblepop.wav"));
|
||||
|
||||
var ws;
|
||||
var wsReady = false;
|
||||
var WEB_SOCKET_URL = "ws://chat.projectathena.io:8880"; // WebSocket for Grid chat.
|
||||
var WEB_SOCKET_URL = "ws://chat.vircadia.com:8880"; // WebSocket for Grid chat.
|
||||
var shutdownBool = false;
|
||||
|
||||
var defaultColour = {red: 255, green: 255, blue: 255};
|
||||
|
@ -80,12 +88,12 @@ function init() {
|
|||
setupHistoryWindow(false);
|
||||
|
||||
chatBar = new OverlayWindow({
|
||||
source: Paths.defaultScripts + '/communityModules/chat/FloofChat.qml?' + Date.now(),
|
||||
source: ROOT + "FloofChat.qml?" + Date.now(),
|
||||
width: 360,
|
||||
height: 180
|
||||
});
|
||||
|
||||
button.clicked.connect(toggleChatHistory);
|
||||
button.clicked.connect(toggleMainChatWindow);
|
||||
chatBar.fromQml.connect(fromQml);
|
||||
chatBar.sendToQml(JSON.stringify({visible: false, history: chatBarHistory}));
|
||||
Controller.keyPressEvent.connect(keyPressEvent);
|
||||
|
@ -106,6 +114,11 @@ function connectWebSocket(timeout) {
|
|||
}
|
||||
if (!cmd.FAILED) {
|
||||
addToLog(cmd.message, cmd.displayName, cmd.colour, cmd.channel);
|
||||
|
||||
if (!mutedAudio["Grid"] && MyAvatar.sessionDisplayName !== cmd.displayName) {
|
||||
playNotificationSound();
|
||||
}
|
||||
|
||||
if (!muted["Grid"]) {
|
||||
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||
sender: "(G) " + cmd.displayName,
|
||||
|
@ -166,13 +179,13 @@ function setupHistoryWindow() {
|
|||
chatHistory = new OverlayWebWindow({
|
||||
title: 'Chat',
|
||||
source: ROOT + "FloofChat.html?appUUID=" + appUUID + "&" + Date.now(),
|
||||
width: 900,
|
||||
height: 700,
|
||||
width: MAIN_CHAT_WINDOW_WIDTH,
|
||||
height: MAIN_CHAT_WINDOW_HEIGHT,
|
||||
visible: false
|
||||
});
|
||||
chatHistory.setPosition({x: 0, y: Window.innerHeight - 700});
|
||||
chatHistory.setPosition({x: 0, y: Window.innerHeight - MAIN_CHAT_WINDOW_HEIGHT});
|
||||
chatHistory.webEventReceived.connect(onWebEventReceived);
|
||||
chatHistory.closed.connect(toggleChatHistory);
|
||||
chatHistory.closed.connect(toggleMainChatWindow);
|
||||
}
|
||||
|
||||
function emitScriptEvent(obj) {
|
||||
|
@ -180,7 +193,7 @@ function emitScriptEvent(obj) {
|
|||
tablet.emitScriptEvent(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
function toggleChatHistory() {
|
||||
function toggleMainChatWindow() {
|
||||
historyVisible = !historyVisible;
|
||||
button.editProperties({isActive: historyVisible});
|
||||
chatHistory.visible = historyVisible;
|
||||
|
@ -282,18 +295,23 @@ function onWebEventReceived(event) {
|
|||
if (event.type === "ready") {
|
||||
chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: historyLog}));
|
||||
chatHistory.emitScriptEvent(JSON.stringify({type: "CMD", cmd: "MUTED", muted: muted}));
|
||||
chatHistory.emitScriptEvent(JSON.stringify({type: "CMD", cmd: "MUTEDAUDIO", muted: mutedAudio}));
|
||||
}
|
||||
if (event.type === "CMD") {
|
||||
if (event.cmd === "MUTED") {
|
||||
muted = event.muted;
|
||||
Settings.setValue(settingsRoot + "/muted", muted);
|
||||
}
|
||||
if (event.cmd === "MUTEDAUDIO") {
|
||||
mutedAudio = event.muted;
|
||||
Settings.setValue(settingsRoot + "/mutedAudio", mutedAudio);
|
||||
}
|
||||
if (event.cmd === "COLOUR") {
|
||||
Settings.setValue(settingsRoot + "/" + event.colourType + "Colour", event.colour);
|
||||
colours[event.colourType] = event.colour;
|
||||
}
|
||||
if (event.cmd === "REDOCK") {
|
||||
chatHistory.setPosition({x: 0, y: Window.innerHeight - 700});
|
||||
chatHistory.setPosition({x: 0, y: Window.innerHeight - MAIN_CHAT_WINDOW_HEIGHT});
|
||||
}
|
||||
if (event.cmd === "GOTO") {
|
||||
gotoConfirm(event.url);
|
||||
|
@ -307,12 +325,15 @@ function onWebEventReceived(event) {
|
|||
visible: true
|
||||
});
|
||||
}
|
||||
if (event.cmd === "EXTERNALURL") {
|
||||
Window.openUrl(event.url);
|
||||
}
|
||||
if (event.cmd === "COPY") {
|
||||
Window.copyToClipboard(event.url);
|
||||
}
|
||||
}
|
||||
if (event.type === "WEBMSG") {
|
||||
event.avatarName = MyAvatar.displayName;
|
||||
event.avatarName = MyAvatar.sessionDisplayName;
|
||||
event = processChat(event);
|
||||
if (event.message === "") return;
|
||||
sendWS({
|
||||
|
@ -325,7 +346,7 @@ function onWebEventReceived(event) {
|
|||
});
|
||||
}
|
||||
if (event.type === "MSG") {
|
||||
event.avatarName = MyAvatar.displayName;
|
||||
event.avatarName = MyAvatar.sessionDisplayName;
|
||||
event = processChat(event);
|
||||
if (event.message === "") return;
|
||||
Messages.sendMessage("Chat", JSON.stringify({
|
||||
|
@ -340,6 +361,17 @@ function onWebEventReceived(event) {
|
|||
}
|
||||
}
|
||||
|
||||
function playNotificationSound() {
|
||||
if (notificationSound.downloaded) {
|
||||
var injectorOptions = {
|
||||
localOnly: true,
|
||||
position: MyAvatar.position,
|
||||
volume: 0.02
|
||||
};
|
||||
Audio.playSound(notificationSound, injectorOptions);
|
||||
}
|
||||
}
|
||||
|
||||
function replaceFormatting(text) {
|
||||
var found = false;
|
||||
if (text.indexOf("**") !== -1) {
|
||||
|
@ -423,6 +455,11 @@ function messageReceived(channel, message) {
|
|||
if (cmd.channel === "Local") {
|
||||
if (Vec3.withinEpsilon(MyAvatar.position, cmd.position, 20)) {
|
||||
addToLog(cmd.message, cmd.displayName, cmd.colour, cmd.channel);
|
||||
|
||||
if (!mutedAudio["Local"] && MyAvatar.sessionDisplayName !== cmd.displayName) {
|
||||
playNotificationSound();
|
||||
}
|
||||
|
||||
if (!muted["Local"]) {
|
||||
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||
sender: "(L) " + cmd.displayName,
|
||||
|
@ -433,6 +470,11 @@ function messageReceived(channel, message) {
|
|||
}
|
||||
} else if (cmd.channel === "Domain") {
|
||||
addToLog(cmd.message, cmd.displayName, cmd.colour, cmd.channel);
|
||||
|
||||
if (!mutedAudio["Domain"] && MyAvatar.sessionDisplayName !== cmd.displayName) {
|
||||
playNotificationSound();
|
||||
}
|
||||
|
||||
if (!muted["Domain"]) {
|
||||
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||
sender: "(D) " + cmd.displayName,
|
||||
|
@ -442,6 +484,11 @@ function messageReceived(channel, message) {
|
|||
}
|
||||
} else if (cmd.channel === "Grid") {
|
||||
addToLog(cmd.message, cmd.displayName, cmd.colour, cmd.channel);
|
||||
|
||||
if (!mutedAudio["Grid"] && MyAvatar.sessionDisplayName !== cmd.displayName) {
|
||||
playNotificationSound();
|
||||
}
|
||||
|
||||
if (!muted["Grid"]) {
|
||||
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||
sender: "(G) " + cmd.displayName,
|
||||
|
@ -451,6 +498,11 @@ function messageReceived(channel, message) {
|
|||
}
|
||||
} else {
|
||||
addToLog(cmd.message, cmd.displayName, cmd.colour, cmd.channel);
|
||||
|
||||
if (MyAvatar.sessionDisplayName !== cmd.displayName) {
|
||||
playNotificationSound();
|
||||
}
|
||||
|
||||
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
|
||||
sender: cmd.displayName,
|
||||
text: replaceFormatting(cmd.message),
|
||||
|
@ -464,19 +516,22 @@ function messageReceived(channel, message) {
|
|||
|
||||
function time() {
|
||||
var d = new Date();
|
||||
var month = (d.getMonth()).toString();
|
||||
var day = (d.getDate()).toString();
|
||||
var h = (d.getHours()).toString();
|
||||
var m = (d.getMinutes()).toString();
|
||||
var s = (d.getSeconds()).toString();
|
||||
var h2 = ("0" + h).slice(-2);
|
||||
var m2 = ("0" + m).slice(-2);
|
||||
var s2 = ("0" + s).slice(-2);
|
||||
s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1);
|
||||
return h2 + ":" + m2 + ":" + s2;
|
||||
// s2 += (d.getMilliseconds() / 1000).toFixed(2).slice(1);
|
||||
return month + "/" + day + " - " + h2 + ":" + m2 + ":" + s2;
|
||||
}
|
||||
|
||||
function addToLog(msg, dp, colour, tab) {
|
||||
historyLog.push([time(), msg, dp, colour, tab]);
|
||||
chatHistory.emitScriptEvent(JSON.stringify({type: "MSG", data: [[time(), msg, dp, colour, tab]]}));
|
||||
var currentTimestamp = time();
|
||||
historyLog.push([currentTimestamp, msg, dp, colour, tab]);
|
||||
chatHistory.emitScriptEvent(JSON.stringify({ type: "MSG", data: [[currentTimestamp, msg, dp, colour, tab]]}));
|
||||
while (historyLog.length > chatHistoryLimit) {
|
||||
historyLog.shift();
|
||||
}
|
||||
|
@ -503,7 +558,7 @@ function fromQml(message) {
|
|||
if (cmd.message !== "") {
|
||||
addToChatBarHistory(cmd.message);
|
||||
if (cmd.event.modifiers === CONTROL_KEY) {
|
||||
cmd.avatarName = MyAvatar.displayName;
|
||||
cmd.avatarName = MyAvatar.sessionDisplayName;
|
||||
cmd = processChat(cmd);
|
||||
if (cmd.message === "") return;
|
||||
Messages.sendMessage(FLOOF_CHAT_CHANNEL, JSON.stringify({
|
||||
|
@ -512,7 +567,7 @@ function fromQml(message) {
|
|||
displayName: cmd.avatarName
|
||||
}));
|
||||
} else if (cmd.event.modifiers === CONTROL_KEY + SHIFT_KEY) {
|
||||
cmd.avatarName = MyAvatar.displayName;
|
||||
cmd.avatarName = MyAvatar.sessionDisplayName;
|
||||
cmd = processChat(cmd);
|
||||
if (cmd.message === "") return;
|
||||
sendWS({
|
||||
|
@ -524,7 +579,7 @@ function fromQml(message) {
|
|||
displayName: cmd.avatarName
|
||||
});
|
||||
} else {
|
||||
cmd.avatarName = MyAvatar.displayName;
|
||||
cmd.avatarName = MyAvatar.sessionDisplayName;
|
||||
cmd = processChat(cmd);
|
||||
if (cmd.message === "") return;
|
||||
Messages.sendMessage(FLOOF_CHAT_CHANNEL, JSON.stringify({
|
||||
|
@ -540,7 +595,7 @@ function fromQml(message) {
|
|||
setVisible(false);
|
||||
} else if (cmd.type === "CMD") {
|
||||
if (cmd.cmd === "Clicked") {
|
||||
toggleChatHistory()
|
||||
toggleMainChatWindow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -565,7 +620,7 @@ function setVisible(_visible) {
|
|||
|
||||
function keyPressEvent(event) {
|
||||
if (event.key === H_KEY && !event.isAutoRepeat && event.isControl) {
|
||||
toggleChatHistory()
|
||||
toggleMainChatWindow()
|
||||
}
|
||||
if (event.key === ENTER_KEY && !event.isAutoRepeat && !visible) {
|
||||
setVisible(true);
|
||||
|
@ -588,4 +643,4 @@ function shutdown() {
|
|||
}
|
||||
chatBar.close();
|
||||
chatHistory.close();
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
@ -50,6 +50,12 @@ div.dockButton button.active {
|
|||
border-top: none;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
width: 250px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -69,9 +75,10 @@ body {
|
|||
}
|
||||
|
||||
.ChatLog {
|
||||
height: calc(100vh - 137px);
|
||||
padding: 20px !important;
|
||||
font-size: 20px;
|
||||
height: calc(100vh - 127px);
|
||||
padding: 10px !important;
|
||||
font-size: 18px;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
color: white;
|
||||
background-color: black;
|
||||
overflow-x: hidden;
|
||||
|
@ -80,7 +87,7 @@ body {
|
|||
}
|
||||
|
||||
.ChatLogLine {
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
.ChatLogLineDisplayName {
|
||||
|
@ -91,25 +98,30 @@ body {
|
|||
}
|
||||
|
||||
.LogLogLine {
|
||||
margin-bottom: 15px;
|
||||
padding: 10px !important;
|
||||
margin-bottom: 7px;
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.LogLogLineMessage {
|
||||
/*font-style: italic;*/
|
||||
}
|
||||
|
||||
.LogLogLineTimestamp {
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.ChatInput {
|
||||
color: #252525;
|
||||
background: #252525;
|
||||
height: 60px !important;
|
||||
height: 45px !important;
|
||||
}
|
||||
|
||||
.ChatInputText {
|
||||
padding: 5px !important;
|
||||
height: 50px !important;
|
||||
padding: 5px 5px 5px 10px !important;
|
||||
height: 35px !important;
|
||||
width: calc(100vw - 20px) !important;
|
||||
font-size: 20px !important;
|
||||
font-size: 18px !important;
|
||||
background-color: white !important;
|
||||
border-style: solid !important;
|
||||
border-color: #232323 !important;
|
||||
|
@ -146,6 +158,14 @@ body {
|
|||
background-color: #a62113 !important;
|
||||
}
|
||||
|
||||
#muteText {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#muteAudioText {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
img, a{
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
BIN
scripts/communityScripts/chat/resources/bubblepop.wav
Normal file
BIN
scripts/communityScripts/chat/resources/bubblepop.wav
Normal file
Binary file not shown.
|
@ -38,11 +38,11 @@ var DEFAULT_SCRIPTS_COMBINED = [
|
|||
];
|
||||
var DEFAULT_SCRIPTS_SEPARATE = [
|
||||
"system/controllers/controllerScripts.js",
|
||||
"communityModules/notificationCore/notificationCore.js",
|
||||
"communityScripts/notificationCore/notificationCore.js",
|
||||
"simplifiedUI/ui/simplifiedNametag/simplifiedNametag.js",
|
||||
{"stable": "system/more/app-more.js", "beta": "https://cdn.vircadia.com/community-apps/more/app-more.js"},
|
||||
{"stable": "communityScripts/explore/explore.js", "beta": "https://metaverse.vircadia.com/interim/d-goto/app/explore.js"},
|
||||
{"stable": "communityModules/chat/FloofChat.js", "beta": "https://content.fluffy.ws/scripts/chat/FloofChat.js"}
|
||||
{"stable": "communityScripts/chat/FloofChat.js", "beta": "https://content.fluffy.ws/scripts/chat/FloofChat.js"}
|
||||
//"system/chat.js"
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue