From 394c9e2175f36af12395376fe11c7205043599fd Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Fri, 26 Jun 2020 21:48:58 -0400 Subject: [PATCH] Chat window resize, shrink text size and boxes, add date to timestamp. --- scripts/communityScripts/chat/FloofChat.html | 3 ++- scripts/communityScripts/chat/FloofChat.js | 23 +++++++++++-------- .../communityScripts/chat/css/FloofChat.css | 21 +++++++++-------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/scripts/communityScripts/chat/FloofChat.html b/scripts/communityScripts/chat/FloofChat.html index a1e84e132f..3f4e19685b 100644 --- a/scripts/communityScripts/chat/FloofChat.html +++ b/scripts/communityScripts/chat/FloofChat.html @@ -12,6 +12,7 @@ + @@ -191,7 +192,7 @@ } // else fall through to default default: - elContent = elContent.replace(this, "
" + this + ""); + elContent = elContent.replace(this, "
" + this + ""); break; } diff --git a/scripts/communityScripts/chat/FloofChat.js b/scripts/communityScripts/chat/FloofChat.js index f8afc67603..e492b04b1b 100644 --- a/scripts/communityScripts/chat/FloofChat.js +++ b/scripts/communityScripts/chat/FloofChat.js @@ -23,6 +23,9 @@ 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; + Script.scriptEnding.connect(function () { shutdown(); }); @@ -50,14 +53,14 @@ 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 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}; @@ -166,11 +169,11 @@ 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); } @@ -293,7 +296,7 @@ function onWebEventReceived(event) { 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); @@ -464,14 +467,16 @@ 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) { diff --git a/scripts/communityScripts/chat/css/FloofChat.css b/scripts/communityScripts/chat/css/FloofChat.css index 476712ffbb..f9d4bb1187 100644 --- a/scripts/communityScripts/chat/css/FloofChat.css +++ b/scripts/communityScripts/chat/css/FloofChat.css @@ -69,9 +69,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 +81,7 @@ body { } .ChatLogLine { - margin-bottom: 15px; + margin-bottom: 7px; } .ChatLogLineDisplayName { @@ -91,8 +92,8 @@ body { } .LogLogLine { - margin-bottom: 15px; - padding: 10px !important; + margin-bottom: 7px; + padding: 6px !important; } .LogLogLineMessage { @@ -102,14 +103,14 @@ body { .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;