From 4c4eacaa87b4a7dc9233eccf4611447dcad6a727 Mon Sep 17 00:00:00 2001 From: RblSb Date: Thu, 15 Aug 2024 10:18:38 +0300 Subject: [PATCH] Update tab title when kicked --- res/client.js | 4 +++- res/langs/en.json | 1 + res/langs/ru.json | 1 + src/client/Main.hx | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/res/client.js b/res/client.js index df2a27d..5bab611 100644 --- a/res/client.js +++ b/res/client.js @@ -1681,6 +1681,8 @@ client_Main.prototype = { case "GetYoutubeVideoInfo": break; case "KickClient": + var tmp = "*" + Lang.get("kicked"); + window.document.title = tmp + "*"; this.disabledReconnection = true; this.ws.close(); break; @@ -2160,7 +2162,7 @@ client_Main.prototype = { this.showScrollToChatEndBtn(); } if(this.onBlinkTab == null) { - this.blinkTabWithTitle("*Chat*"); + this.blinkTabWithTitle("*" + Lang.get("chat") + "*"); } } ,showScrollToChatEndBtn: function() { diff --git a/res/langs/en.json b/res/langs/en.json index ac97ac5..3f5d47a 100644 --- a/res/langs/en.json +++ b/res/langs/en.json @@ -61,6 +61,7 @@ "yourPassword": "Your Password", "emotes": "Emotes", "chat": "Chat", + "kicked": "Kicked", "clearChat": "Clear Chat", "chatlinePlaceholder": "Send a message...", "addVideoFromUrl": "Add video from URL", diff --git a/res/langs/ru.json b/res/langs/ru.json index 37ceb6a..932fb94 100644 --- a/res/langs/ru.json +++ b/res/langs/ru.json @@ -61,6 +61,7 @@ "yourPassword": "Ваш пароль", "emotes": "Смайлы", "chat": "Чат", + "kicked": "Выпнут", "clearChat": "Очистить чат", "chatlinePlaceholder": "Введите сообщение...", "addVideoFromUrl": "Добавить видео по ссылке", diff --git a/src/client/Main.hx b/src/client/Main.hx index 6d50b5e..2850c75 100644 --- a/src/client/Main.hx +++ b/src/client/Main.hx @@ -455,6 +455,7 @@ class Main { case BanClient: // server-only case KickClient: + document.title = '*${Lang.get("kicked")}*'; disabledReconnection = true; ws.close(); case Message: @@ -967,7 +968,7 @@ class Main { } else { showScrollToChatEndBtn(); } - if (onBlinkTab == null) blinkTabWithTitle("*Chat*"); + if (onBlinkTab == null) blinkTabWithTitle('*${Lang.get("chat")}*'); } function showScrollToChatEndBtn() {