From 3d74fc8220f00129bef78b808d57e1ae0c02a0cd Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 20 Dec 2017 12:58:59 -0500 Subject: [PATCH] some changes to fix class names used, character countdown support, etc. --- public/src/client/chats.js | 9 +++++---- public/src/client/chats/search.js | 2 ++ src/controllers/api.js | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 44e2a2afd1..7b9131cf05 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -120,6 +120,7 @@ define('forum/chats', [ var element = parent.find('[component="chat/input"]'); element.on('keyup', function () { 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 () { mousetrap.bind('ctrl+up', function () { - var activeContact = $('.chats-list .bg-primary'); + var activeContact = $('.chats-list .bg-info'); var prev = activeContact.prev(); if (prev.length) { @@ -155,7 +156,7 @@ define('forum/chats', [ } }); mousetrap.bind('ctrl+down', function () { - var activeContact = $('.chats-list .bg-primary'); + var activeContact = $('.chats-list .bg-info'); var next = activeContact.next(); if (next.length) { @@ -419,8 +420,8 @@ define('forum/chats', [ socket.emit('modules.chats.markRead', ajaxify.data.roomId); $('.expanded-chat input').focus(); } - $('.chats-list li').removeClass('bg-primary'); - $('.chats-list li[data-roomid="' + ajaxify.data.roomId + '"]').addClass('bg-primary'); + $('.chats-list li').removeClass('bg-info'); + $('.chats-list li[data-roomid="' + ajaxify.data.roomId + '"]').addClass('bg-info'); }; diff --git a/public/src/client/chats/search.js b/public/src/client/chats/search.js index 1b76d665d8..e40551ed05 100644 --- a/public/src/client/chats/search.js +++ b/public/src/client/chats/search.js @@ -52,6 +52,8 @@ define('forum/chats/search', ['components'], function (components) { var chatEl = displayUser(chatsListEl, userObj); onUserClick(chatEl, userObj); }); + + chatsListEl.parent().toggleClass('open', true); } function displayUser(chatsListEl, userObj) { diff --git a/src/controllers/api.js b/src/controllers/api.js index 4f9430826a..a9e3dacf79 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -39,6 +39,7 @@ apiController.loadConfig = function (req, callback) { config.usePagination = parseInt(meta.config.usePagination, 10) === 1; config.disableChat = parseInt(meta.config.disableChat, 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.websocketAddress = nconf.get('socket.io:address') || ''; config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5;