summaryrefslogtreecommitdiff
path: root/static/js/pages/chat_init.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/pages/chat_init.js')
-rw-r--r--static/js/pages/chat_init.js13
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);
-