diff --git a/share/static/css/style.css b/share/static/css/style.css index ee3d1760..043dd7d0 100644 --- a/share/static/css/style.css +++ b/share/static/css/style.css @@ -169,6 +169,7 @@ ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { .chat-container { display: flex; + font-family: monospace; } .chat-users { @@ -177,6 +178,7 @@ ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { border-radius: 2px; overflow: auto; background: #f2f2f2; + margin: 1rem 0 1rem 1rem; } .chat-users .editable-username { @@ -185,6 +187,11 @@ ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { flex-direction: column; } +.chat-users .editable-username input { + font-family: monospace; + font-size: 1em; +} + .chat-users #user-list li { margin-bottom: 1em; } @@ -193,8 +200,8 @@ ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { display: flex; flex-direction: column; flex: 1; - margin: 0 1rem; - height: calc(100vh - (45px + 2em)); + margin: 1rem 1rem 0 1rem; + height: calc(100vh - (65px + 2em)); } .chat-wrapper #chat { @@ -206,6 +213,12 @@ ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { padding: 0 1rem; } +.chat-wrapper .status { + font-style: italic; + font-size: 0.8em; + color: #666666; +} + .chat-wrapper .username { font-weight: bold; display: block; @@ -217,11 +230,16 @@ ul.breadcrumbs li a:link, ul.breadcrumbs li a:visited { } .chat-wrapper .chat-form { - display: flex; + display: block; + margin: 0.2rem 1rem 1rem 0; + padding: -0.5em; } .chat-wrapper input#new-message { height: 100%; + width: 100%; + font-family: monospace; + font-size: 1em; } @media (max-width: 992px) { diff --git a/share/static/js/chat.js b/share/static/js/chat.js index 95cd5d8a..3425d516 100644 --- a/share/static/js/chat.js +++ b/share/static/js/chat.js @@ -41,27 +41,16 @@ $(function () { emitMessage(socket); } }); - $('#send-button').on('click', function (e) { - emitMessage(socket); - }); // Keep buttons disabled unless changed or not empty $('#username').on('keyup', function (event) { if ($('#username').val() !== '' && $('#username').val() !== current_username) { - $('#update-username').removeAttr('disabled'); if (event.keyCode == 13) { current_username = updateUsername(socket); } - } else { - $('#update-username').attr('disabled', true); } }); - // Update username - $('#update-username').on('click', function () { - current_username = updateUsername(socket); - }); - // Show warning of losing data $(window).on('beforeunload', function (e) { e.preventDefault(); @@ -103,7 +92,6 @@ var updateUsername = function (socket) { }).done(function (response) { console.log(response); }); - $('#update-username').attr('disabled', true); return username; } @@ -138,7 +126,7 @@ var scrollBottomMaybe = function (scrollDiff) { var addStatusMessage = function (message) { $('#chat').append( - `
${sanitizeHTML(message)}
` + `${sanitizeHTML(message)}
` ); } diff --git a/share/templates/chat.html b/share/templates/chat.html index 102f1027..474550cd 100644 --- a/share/templates/chat.html +++ b/share/templates/chat.html @@ -24,19 +24,15 @@Chat Messages
-