From 4aa87366f9cd8c80ae481bf43e0316d34002f71a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 30 Apr 2023 12:47:00 -0400 Subject: [PATCH] feat: #11537, copy ip on click --- public/language/en-GB/global.json | 1 + public/src/client/chats.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/language/en-GB/global.json b/public/language/en-GB/global.json index c5dee756b7..c4b031520b 100644 --- a/public/language/en-GB/global.json +++ b/public/language/en-GB/global.json @@ -160,6 +160,7 @@ "edited": "Edited", "disabled": "Disabled", "select": "Select", + "copied": "Copied", "user-search-prompt": "Type something here to find users...", "hidden": "Hidden", diff --git a/public/src/client/chats.js b/public/src/client/chats.js index df57760977..246754add5 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -110,7 +110,12 @@ define('forum/chats', [ if (err) { return alerts.error(err); } - ipEl.html(ip); + ipEl.text(ip); + ipEl.on('click', () => { + navigator.clipboard.writeText(ip); + ipEl.translateText('[[global:copied]]'); + setTimeout(() => ipEl.text(ip), 2000); + }); }); }); };