diff options
| author | yo momma <shutup@oops.wtf> | 2026-01-30 09:52:51 +0000 |
|---|---|---|
| committer | yo momma <shutup@oops.wtf> | 2026-01-30 09:52:51 +0000 |
| commit | 5bcf2586305bb9f246497558f46f2fa15f686364 (patch) | |
| tree | b08e56aebc4f1b27dda222f8f46e7c3f3d8d780d /static/js/pages/chat_init.js | |
| parent | 5aea6f7791d9a5238581b04d2198205c90495baf (diff) | |
Fix: restore hotlinks + cache-bust pichat.js
Diffstat (limited to 'static/js/pages/chat_init.js')
| -rw-r--r-- | static/js/pages/chat_init.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/static/js/pages/chat_init.js b/static/js/pages/chat_init.js index 58dba07..7149291 100644 --- a/static/js/pages/chat_init.js +++ b/static/js/pages/chat_init.js @@ -23,9 +23,17 @@ if (typeof window.Recips === 'undefined') { window.Recips = []; } var hasMessageList = document.getElementById('messageList') !== null; + var hasChatInput = document.getElementById('msgInput') !== null; + + if (hasMessageList && hasChatInput && typeof window.initChat === 'function') { window.initChat(); } + if (hasMessageList && hasChatInput && typeof window.initChatMsgs === 'function') { window.initChatMsgs(); } + + // Some room pages render dumps in `.logged-dump` containers without the full chat UI. + // In that case, run the log initializer so URLs become hotlinked images. + if (!hasChatInput && typeof window.initLog === 'function' && jQuery('.logged-dump .content').length) { + window.initLog(window.Recips); + } - if (hasMessageList && typeof window.initChat === 'function') { window.initChat(); } - if (hasMessageList && typeof window.initChatMsgs === 'function') { window.initChatMsgs(); } if (typeof window.Away !== 'undefined' && typeof window.Away.startTitleUpdater === 'function') { window.Away.startTitleUpdater(); } if (window.Nick && typeof window.setupUpload === 'function' && typeof window.Room !== 'undefined') { @@ -33,4 +41,3 @@ } }); })(jQuery); - |
