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); + }); }); }); };