From 8dfd57d0638628117c4e689b8609841552a26f5d Mon Sep 17 00:00:00 2001
From: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com>
Date: Mon, 16 Nov 2020 20:50:18 +0100
Subject: add css to hide the shownames
---
webAO/client.html | 1 +
webAO/styles/nameplates.css | 7 +++++++
webAO/styles/shownames.css | 7 +++++++
3 files changed, 15 insertions(+)
create mode 100644 webAO/styles/nameplates.css
create mode 100644 webAO/styles/shownames.css
diff --git a/webAO/client.html b/webAO/client.html
index b5392ee..2c689d2 100644
--- a/webAO/client.html
+++ b/webAO/client.html
@@ -33,6 +33,7 @@
+
Date: Mon, 16 Nov 2020 20:51:58 +0100
Subject: add both names and toggle it with the checkbox
---
webAO/client.js | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/webAO/client.js b/webAO/client.js
index f21056b..baaf4ca 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -463,6 +463,7 @@ class Client extends EventEmitter {
document.getElementById("ic_chat_name").value = getCookie("ic_chat_name");
document.getElementById("showname").checked = getCookie("showname");
+ showname_click();
document.getElementById("client_callwords").value = getCookie("callwords");
}
@@ -1891,7 +1892,7 @@ async changeBackground(position) {
}
this.lastChar = this.chatmsg.name;
- appendICLog(this.chatmsg.content, displayname);
+ appendICLog(this.chatmsg.content, this.chatmsg.showname, this.chatmsg.nameplate);
checkCallword(this.chatmsg.content);
@@ -2383,6 +2384,13 @@ window.mutelist_click = mutelist_click;
export function showname_click(_event) {
setCookie("showname", document.getElementById("showname").checked);
setCookie("ic_chat_name", document.getElementById("ic_chat_name").value);
+
+ const css_s = document.getElementById("nameplate_setting");
+
+ if (document.getElementById("showname").checked)
+ css_s.href = "styles/shownames.css";
+ else
+ css_s.href = "styles/nameplates.css";
}
window.showname_click = showname_click;
@@ -2658,17 +2666,25 @@ window.ReconnectButton = ReconnectButton;
* @param {string} msg the string to be added
* @param {string} name the name of the sender
*/
-function appendICLog(msg, name = "", time = new Date()) {
+function appendICLog(msg, showname = "", nameplate = "", time = new Date()) {
const entry = document.createElement("p");
- const nameField = document.createElement("span");
- const textField = document.createElement("span");
- nameField.className = "iclog_name";
- nameField.appendChild(document.createTextNode(name));
+ const shownameField = document.createElement("span");
+ const nameplateField = document.createElement("span");
+ const textField = document.createElement("span");
+ nameplateField.classList = "iclog_name iclog_nameplate";
+ nameplateField.appendChild(document.createTextNode(nameplate));
+
+ shownameField.classList = "iclog_name iclog_showname";
+ if (showname === "" || !showname)
+ shownameField.appendChild(document.createTextNode(nameplate));
+ else
+ shownameField.appendChild(document.createTextNode(showname));
textField.className = "iclog_text";
textField.appendChild(document.createTextNode(msg));
- entry.appendChild(nameField);
+ entry.appendChild(shownameField);
+ entry.appendChild(nameplateField);
entry.appendChild(textField);
// Only put a timestamp if the minute has changed.
--
cgit