aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/assets
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-06 21:26:54 +0300
committerGravatar Vitaly Takmazov2018-10-06 21:26:54 +0300
commit312b2408d72d11caf4d88cfbf07157ead220347f (patch)
treeb3c66d350ed6513526f37aa5a4d1df9600191f98 /juick-server/src/main/assets
parent8706a64c522ecfcd54577b4aac575a5ca4dba124 (diff)
Replies formatting for anonymous users
Diffstat (limited to 'juick-server/src/main/assets')
-rw-r--r--juick-server/src/main/assets/scripts.js12
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);