some changes to fix class names used, character countdown support, etc.

v1.18.x
Julian Lam 7 years ago
parent d967201b2a
commit 3d74fc8220

@ -120,6 +120,7 @@ define('forum/chats', [
var element = parent.find('[component="chat/input"]'); var element = parent.find('[component="chat/input"]');
element.on('keyup', function () { element.on('keyup', function () {
parent.find('[component="chat/message/length"]').text(element.val().length); parent.find('[component="chat/message/length"]').text(element.val().length);
parent.find('[component="chat/message/remaining"]').text(config.maximumChatMessageLength - element.val().length);
}); });
}; };
@ -147,7 +148,7 @@ define('forum/chats', [
Chats.addHotkeys = function () { Chats.addHotkeys = function () {
mousetrap.bind('ctrl+up', function () { mousetrap.bind('ctrl+up', function () {
var activeContact = $('.chats-list .bg-primary'); var activeContact = $('.chats-list .bg-info');
var prev = activeContact.prev(); var prev = activeContact.prev();
if (prev.length) { if (prev.length) {
@ -155,7 +156,7 @@ define('forum/chats', [
} }
}); });
mousetrap.bind('ctrl+down', function () { mousetrap.bind('ctrl+down', function () {
var activeContact = $('.chats-list .bg-primary'); var activeContact = $('.chats-list .bg-info');
var next = activeContact.next(); var next = activeContact.next();
if (next.length) { if (next.length) {
@ -419,8 +420,8 @@ define('forum/chats', [
socket.emit('modules.chats.markRead', ajaxify.data.roomId); socket.emit('modules.chats.markRead', ajaxify.data.roomId);
$('.expanded-chat input').focus(); $('.expanded-chat input').focus();
} }
$('.chats-list li').removeClass('bg-primary'); $('.chats-list li').removeClass('bg-info');
$('.chats-list li[data-roomid="' + ajaxify.data.roomId + '"]').addClass('bg-primary'); $('.chats-list li[data-roomid="' + ajaxify.data.roomId + '"]').addClass('bg-info');
}; };

@ -52,6 +52,8 @@ define('forum/chats/search', ['components'], function (components) {
var chatEl = displayUser(chatsListEl, userObj); var chatEl = displayUser(chatsListEl, userObj);
onUserClick(chatEl, userObj); onUserClick(chatEl, userObj);
}); });
chatsListEl.parent().toggleClass('open', true);
} }
function displayUser(chatsListEl, userObj) { function displayUser(chatsListEl, userObj) {

@ -39,6 +39,7 @@ apiController.loadConfig = function (req, callback) {
config.usePagination = parseInt(meta.config.usePagination, 10) === 1; config.usePagination = parseInt(meta.config.usePagination, 10) === 1;
config.disableChat = parseInt(meta.config.disableChat, 10) === 1; config.disableChat = parseInt(meta.config.disableChat, 10) === 1;
config.disableChatMessageEditing = parseInt(meta.config.disableChatMessageEditing, 10) === 1; config.disableChatMessageEditing = parseInt(meta.config.disableChatMessageEditing, 10) === 1;
config.maximumChatMessageLength = parseInt(meta.config.maximumChatMessageLength, 10) || 1000;
config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket']; config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket'];
config.websocketAddress = nconf.get('socket.io:address') || ''; config.websocketAddress = nconf.get('socket.io:address') || '';
config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5; config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5;

Loading…
Cancel
Save