firing hook on chat message load and exposing upload_url to client-side

v1.18.x
Julian Lam 7 years ago
parent 49c4a23e04
commit 5c3155f145

@ -82,6 +82,10 @@ define('forum/chats/messages', ['components', 'sounds', 'translator', 'benchpres
newMessage.find('.timeago').timeago();
newMessage.find('img:not(.not-responsive)').addClass('img-responsive');
messages.scrollToBottom(chatContentEl);
$(window).trigger('action:chat.received', {
messageEl: newMessage,
});
}

@ -18,6 +18,7 @@ var apiController = module.exports;
apiController.loadConfig = function (req, callback) {
var config = {};
config.relative_path = nconf.get('relative_path');
config.upload_url = nconf.get('upload_url');
config.siteTitle = validator.escape(String(meta.config.title || meta.config.browserTitle || 'NodeBB'));
config.browserTitle = validator.escape(String(meta.config.browserTitle || meta.config.title || 'NodeBB'));
config.titleLayout = (meta.config.titleLayout || '{pageTitle} | {browserTitle}').replace(/{/g, '{').replace(/}/g, '}');

Loading…
Cancel
Save