From d450644ce614f9a356c90ddc7a3b8c5493efd995 Mon Sep 17 00:00:00 2001
From: Alex <153463501+3-alex@users.noreply.github.com>
Date: Mon, 9 Mar 2026 18:55:42 -0400
Subject: [PATCH 01/11] bugfixes without the giant diff
---
client/screen.css | 2 +-
client/script.js | 68 ++++++++++++++++++++++++++++++++++-------------
2 files changed, 51 insertions(+), 19 deletions(-)
diff --git a/client/screen.css b/client/screen.css
index 65044f13..ce43b105 100644
--- a/client/screen.css
+++ b/client/screen.css
@@ -1407,7 +1407,7 @@ input[type="range"]:hover {
z-index: 900;
}
-.participant-menu {
+.participant-menu, .top {
z-index: 1000;
}
diff --git a/client/script.js b/client/script.js
index 455269fe..a70e2fde 100644
--- a/client/script.js
+++ b/client/script.js
@@ -1832,6 +1832,7 @@ $(function() {
var gHideChat = localStorage.hideChat == "true";
var gNoPreventDefault = localStorage.noPreventDefault == "true";
var gHideBotUsers = localStorage.hideBotUsers == "true";
+ var gCancelDMs = localStorage.cancelDMs == "true";
var gSnowflakes =
new Date().getMonth() === 11 && localStorage.snowflakes !== "false";
@@ -2244,8 +2245,32 @@ $(function() {
gClient.on("participant removed", (part) => {
if (gIsDming && part._id === gDmParticipant._id) {
chat.endDM();
- chat.endDM();
- }
+ if (!gCancelDMs) {
+ new Notification({title: 'DM Cancelled',
+ html: gHasSeenDMWarning ?
+ `Your message is still in the chat input field, but will send as a public message.
+ You can disable this in Client Settings.`
+ : `Your message is still in the chatbox, but it will send as a public message.
+ You can disable this in Client Settings.
+ Enabling "Cancel DMs when recipient leaves" will clear your message from the text input
+ and unfocus the textbox when the person you're typing to leaves the channel.`,
+ target: "#room",
+ duration: 20000,
+ class: "top"
+ });
+ if (!localStorage.hasSeenDMWarning) gHasSeenDMWarning = true; localStorage.hasSeenDMWarning = true;
+ $("#chat-input").blur();
+ }
+ if (gCancelDMs) {
+ chat.blur();
+ $("#chat input").value = "";
+ new Notification({title: "DM Cancelled",
+ text: `${part.name} left the room.`,
+ target: "#room",
+ duration: 10000
+ });
+ }
+ }
});
//Replies
@@ -2253,11 +2278,6 @@ $(function() {
var gReplyParticipant;
var gIsReplying = false;
var gMessageId;
- gClient.on(`participant removed`, (part) => {
- if (gIsReplying && part._id === gReplyParticipant._id) {
- MPP.chat.cancelReply();
- }
- });
// click participant names
(function() {
@@ -2802,7 +2822,8 @@ $(function() {
$("#room .more").fadeOut(250);
var selected_name = $(evt.target).attr("roomname");
if (typeof selected_name != "undefined") {
- changeRoom(selected_name, "right");
+ if (!evt.ctrlKey) changeRoom(selected_name, "right");
+ else window.open(`?c=${selected_name}`)
}
return false;
}
@@ -2858,7 +2879,7 @@ $(function() {
if (gClient.accountInfo.type === "discord") {
$("#account #avatar-image").prop("src", gClient.accountInfo.avatar);
$("#account #logged-in-user-text").text(
- "@" + gClient.accountInfo.username
+ `@${gClient.accountInfo.username}`
);
}
} else {
@@ -2869,7 +2890,7 @@ $(function() {
var gModal;
function modalHandleEsc(evt) {
- if (evt.keyCode == 27) {
+ if (evt.keyCode == 27 || (evt.keyCode == 32 || evt.keyCode == 13) && document.activeElement.type === "text") {
closeModal();
if (!gNoPreventDefault) evt.preventDefault();
evt.stopPropagation();
@@ -2890,7 +2911,7 @@ $(function() {
}
function closeModal() {
- $(document).off("keydown", modalHandleEsc);
+ $(document).on("keydown", modalHandleEsc);
$("#modal").fadeOut(100);
$("#modal #modals > *").hide();
captureKeyboard();
@@ -3255,7 +3276,7 @@ $(function() {
chat.endDM();
}
if (gIsReplying) {
- chat.cancelReply();
+ chat.cancelReply(part);
}
setTimeout(function() {
chat.blur();
@@ -3341,15 +3362,14 @@ $(function() {
$("#chat-input")[0].placeholder = `Replying to ${part.name} in a DM.`;
},
- cancelReply: function() {
- if (gIsDming) gIsDming = false;
+ cancelReply: function(part) {
gIsReplying = false;
$(`#msg-${gMessageId}`).css({
"background-color": "unset",
border: "1px solid #00000000",
});
$("#chat-input")[0].placeholder = window.i18nextify.i18next.t(
- `You can chat with this thing.`,
+ (gIsDming ? `Direct messaging ${part.name}` : `You can chat with this thing.`),
);
},
@@ -3391,7 +3411,7 @@ $(function() {
},
]);
setTimeout(() => {
- MPP.chat.cancelReply();
+ MPP.chat.cancelReply(gReplyParticipant);
}, 100);
} else {
gClient.sendArray([
@@ -3403,7 +3423,7 @@ $(function() {
},
]);
setTimeout(() => {
- MPP.chat.cancelReply();
+ MPP.chat.cancelReply(gReplyParticipant);
}, 100);
}
} else {
@@ -4779,7 +4799,7 @@ $(function() {
"hide-chat",
"Hide chat",
gHideChat,
- false,
+ true,
html,
() => {
gHideChat = !gHideChat;
@@ -4793,6 +4813,18 @@ $(function() {
},
);
+ createSetting(
+ "cancel-dms",
+ "Cancel DMs when recipient leaves",
+ gCancelDMs,
+ false,
+ html,
+ () => {
+ gCancelDMs = !gCancelDMs;
+ localStorage.cancelDMs = gCancelDMs;
+ },
+ );
+
content.appendChild(html);
break;
From c55fb5eb83ab7fffd1f86773070753d11ffa17f3 Mon Sep 17 00:00:00 2001
From: Alex <153463501+3-alex@users.noreply.github.com>
Date: Mon, 9 Mar 2026 19:25:04 -0400
Subject: [PATCH 02/11] fix modal escape handling
---
client/script.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/client/script.js b/client/script.js
index a70e2fde..f5716905 100644
--- a/client/script.js
+++ b/client/script.js
@@ -1264,7 +1264,7 @@ $(function() {
"This site makes a lot of sound! You may want to adjust the volume before continuing.";
document.getElementById("motd-text").innerHTML = msg.motd;
openModal("#motd");
- $(document).off("keydown", modalHandleEsc);
+ $(document).on("keydown", modalHandleEsc);
var user_interact = function(evt) {
if (
(evt.path || (evt.composedPath && evt.composedPath())).includes(
@@ -2890,7 +2890,7 @@ $(function() {
var gModal;
function modalHandleEsc(evt) {
- if (evt.keyCode == 27 || (evt.keyCode == 32 || evt.keyCode == 13) && document.activeElement.type === "text") {
+ if (evt.keyCode == 27 || (evt.keyCode == 32 || evt.keyCode == 13) && document.activeElement.type !== "text") {
closeModal();
if (!gNoPreventDefault) evt.preventDefault();
evt.stopPropagation();
@@ -2911,7 +2911,7 @@ $(function() {
}
function closeModal() {
- $(document).on("keydown", modalHandleEsc);
+ $(document).off("keydown", modalHandleEsc);
$("#modal").fadeOut(100);
$("#modal #modals > *").hide();
captureKeyboard();
From a300541f12ebcea764bb42cc090b573d5ee7f9ff Mon Sep 17 00:00:00 2001
From: CanIhavecheezburger0
<81966617+CanIhavecheezburger0@users.noreply.github.com>
Date: Thu, 12 Mar 2026 04:58:01 +1000
Subject: [PATCH 03/11] fix protocol.md (#77)
---
docs/protocol.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/protocol.md b/docs/protocol.md
index c4646d63..d9afdcf3 100644
--- a/docs/protocol.md
+++ b/docs/protocol.md
@@ -814,6 +814,7 @@ This is sent when a client sends a [custom](#custom-server-bound) message.
#### Properties
- `"data"`: The data sent in this custom message. Can be any valid JSON.
- `"p"`: The user id of the client who sent this custom message.
+- `"u"`: The full user info of the client who sent this custom message.
#### Example
```json
{
@@ -823,7 +824,13 @@ This is sent when a client sends a [custom](#custom-server-bound) message.
"hello",
"how are you"
],
- "p":"1dbe9eb24f0f4668cc72ac79"
+ "p":"e597eb458dd0da2b05edb1b1",
+ "u":{
+ "afk": false,
+ "color": "#4ac0e8",
+ "name": "cheezburger0",
+ "_id": "e597eb458dd0da2b05edb1b1"
+ }
}
```
From 12b0031fa59bdb8b41968b1d6967e2174fbe8f2b Mon Sep 17 00:00:00 2001
From: dima
Date: Sat, 3 Aug 2024 09:19:45 +0000
Subject: [PATCH 04/11] Translated using Weblate (English)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/en/
---
client/locales/en/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/en/translation.json b/client/locales/en/translation.json
index 892b70a0..42c90f34 100644
--- a/client/locales/en/translation.json
+++ b/client/locales/en/translation.json
@@ -32,7 +32,7 @@
"Ask bots not to index this room": "Ask bots not to index this room",
"Inner color:": "Inner color:",
"Outer color:": "Outer color:",
- "Player limit:": "Player limit:",
+ "Player limit:": "Player limit lol",
"APPLY": "APPLY",
"My Fancy New Name": "My Fancy New Name",
"USER SET": "USER SET",
From 7fd46acc2ae355b0f154ca2e1983f67dfd73e8e3 Mon Sep 17 00:00:00 2001
From: sophie
Date: Sat, 17 May 2025 07:13:41 +0200
Subject: [PATCH 05/11] Translated using Weblate (English)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/en/
---
client/locales/en/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/en/translation.json b/client/locales/en/translation.json
index 42c90f34..892b70a0 100644
--- a/client/locales/en/translation.json
+++ b/client/locales/en/translation.json
@@ -32,7 +32,7 @@
"Ask bots not to index this room": "Ask bots not to index this room",
"Inner color:": "Inner color:",
"Outer color:": "Outer color:",
- "Player limit:": "Player limit lol",
+ "Player limit:": "Player limit:",
"APPLY": "APPLY",
"My Fancy New Name": "My Fancy New Name",
"USER SET": "USER SET",
From 208d082fdfeef82cdf2d1a71ada741ca413a8c81 Mon Sep 17 00:00:00 2001
From: bittin1ddc447d824349b2
Date: Mon, 19 May 2025 07:26:51 +0200
Subject: [PATCH 06/11] Translated using Weblate (Swedish)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/sv/
---
client/locales/sv/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/sv/translation.json b/client/locales/sv/translation.json
index c276c71a..62001d8d 100644
--- a/client/locales/sv/translation.json
+++ b/client/locales/sv/translation.json
@@ -21,7 +21,7 @@
"Ask bots not to index this room": "Ingen index",
"Inner color:": "Inre färg:",
"Outer color:": "Yttre färg:",
- "Player limit:": "Spelargräns lol",
+ "Player limit:": "Spelargräns:",
"APPLY": "TILLÄMPA",
"My Fancy New Name": "Mitt Fina Nya Namn",
"USER SET": "ANGE",
From cae4dad219db0105438369b9c2a8f4d751706390 Mon Sep 17 00:00:00 2001
From: fucksophie
Date: Thu, 12 Mar 2026 12:30:55 +0200
Subject: [PATCH 07/11] weblate configuration
---
.weblate | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 .weblate
diff --git a/.weblate b/.weblate
new file mode 100644
index 00000000..d0849af0
--- /dev/null
+++ b/.weblate
@@ -0,0 +1,3 @@
+[weblate]
+url = https://hosted.weblate.org/api/
+translation = multiplayerpiano/frontend
From 0f158e6f230eba6d969027bc049d2e28265258fc Mon Sep 17 00:00:00 2001
From: dima
Date: Sat, 3 Aug 2024 09:19:45 +0000
Subject: [PATCH 08/11] Translated using Weblate (English)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/en/
---
client/locales/en/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/en/translation.json b/client/locales/en/translation.json
index 892b70a0..42c90f34 100644
--- a/client/locales/en/translation.json
+++ b/client/locales/en/translation.json
@@ -32,7 +32,7 @@
"Ask bots not to index this room": "Ask bots not to index this room",
"Inner color:": "Inner color:",
"Outer color:": "Outer color:",
- "Player limit:": "Player limit:",
+ "Player limit:": "Player limit lol",
"APPLY": "APPLY",
"My Fancy New Name": "My Fancy New Name",
"USER SET": "USER SET",
From 6d2eabda1d87cc84cb2b260ba4696fa7b6ecf530 Mon Sep 17 00:00:00 2001
From: bittin1ddc447d824349b2
Date: Mon, 5 Aug 2024 12:19:48 +0000
Subject: [PATCH 09/11] Translated using Weblate (Swedish)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/sv/
---
client/locales/sv/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/sv/translation.json b/client/locales/sv/translation.json
index 62001d8d..c276c71a 100644
--- a/client/locales/sv/translation.json
+++ b/client/locales/sv/translation.json
@@ -21,7 +21,7 @@
"Ask bots not to index this room": "Ingen index",
"Inner color:": "Inre färg:",
"Outer color:": "Yttre färg:",
- "Player limit:": "Spelargräns:",
+ "Player limit:": "Spelargräns lol",
"APPLY": "TILLÄMPA",
"My Fancy New Name": "Mitt Fina Nya Namn",
"USER SET": "ANGE",
From 458ecc4f8aa5a2803e234c74e201f56f1b823a2c Mon Sep 17 00:00:00 2001
From: sophie
Date: Sat, 17 May 2025 07:13:41 +0200
Subject: [PATCH 10/11] Translated using Weblate (English)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/en/
---
client/locales/en/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/en/translation.json b/client/locales/en/translation.json
index 42c90f34..892b70a0 100644
--- a/client/locales/en/translation.json
+++ b/client/locales/en/translation.json
@@ -32,7 +32,7 @@
"Ask bots not to index this room": "Ask bots not to index this room",
"Inner color:": "Inner color:",
"Outer color:": "Outer color:",
- "Player limit:": "Player limit lol",
+ "Player limit:": "Player limit:",
"APPLY": "APPLY",
"My Fancy New Name": "My Fancy New Name",
"USER SET": "USER SET",
From 6c8aeae953af9223b39dd7765da11559b767abb7 Mon Sep 17 00:00:00 2001
From: bittin1ddc447d824349b2
Date: Mon, 19 May 2025 07:26:51 +0200
Subject: [PATCH 11/11] Translated using Weblate (Swedish)
Currently translated at 100.0% (101 of 101 strings)
Translation: multiplayerpiano/frontend
Translate-URL: https://hosted.weblate.org/projects/multiplayerpiano/frontend/sv/
---
client/locales/sv/translation.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/locales/sv/translation.json b/client/locales/sv/translation.json
index c276c71a..62001d8d 100644
--- a/client/locales/sv/translation.json
+++ b/client/locales/sv/translation.json
@@ -21,7 +21,7 @@
"Ask bots not to index this room": "Ingen index",
"Inner color:": "Inre färg:",
"Outer color:": "Yttre färg:",
- "Player limit:": "Spelargräns lol",
+ "Player limit:": "Spelargräns:",
"APPLY": "TILLÄMPA",
"My Fancy New Name": "Mitt Fina Nya Namn",
"USER SET": "ANGE",