diff options
Diffstat (limited to 'juick-server/src/main/assets/scripts.js')
-rw-r--r-- | juick-server/src/main/assets/scripts.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/juick-server/src/main/assets/scripts.js b/juick-server/src/main/assets/scripts.js index 89c5c45f..1f2efd33 100644 --- a/juick-server/src/main/assets/scripts.js +++ b/juick-server/src/main/assets/scripts.js @@ -884,6 +884,18 @@ ready(function() { }); } }); + document.querySelectorAll('[data-user-uri]').forEach(el => { + let dataUri = el.getAttribute('href'); + if (dataUri) { + fetchUserUri(dataUri, user => { + let textNode = el.childNodes[0]; + if (textNode.nodeType === Node.TEXT_NODE && textNode.nodeValue.trim().length > 0) { + let uname = document.createTextNode(`@${user.uname}`); + el.replaceChild(uname, el.firstChild); + } + }); + } + }); initWS(); window.addEventListener('pagehide', wsShutdown); |