From 5e9058faa678a35b6bb23ec99a803ec1977d8fab Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Mon, 2 Jun 2014 23:08:03 +0200 Subject: [PATCH] Re-implemented the 'Show more' button --- README.md | 8 ++++++++ client/css/style.css | 19 +++++++++++++++++++ client/index.html | 5 ++++- client/js/chat.js | 42 ++++++++++++++++++++++++++++++++++-------- config.js | 1 + lib/models/chan.js | 9 +++++++++ lib/server.js | 21 +++++++++++++++++++-- 7 files changed, 94 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 897c41b6..2b2697fc 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,19 @@ socket.emit("join", { id: 0, name: "", type: "", + count: 0, messages: [], users: [], } }); +// Event: "messages" +// Sent after the server receives a "fetch" request from client. +socket.emit("messages", { + id: 0, + msg: [] +}); + // Event: "msg" // Sent when receiving a message. socket.emit("msg", { diff --git a/client/css/style.css b/client/css/style.css index 0dab6e58..cad01448 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -209,6 +209,25 @@ button { right: 180px; top: 0; } +#chat .show-more { + border-bottom: 1px solid #eee; + color: #bec5d0; + font: 12px Lato, sans-serif; + line-height: 1.8em; + padding: 10px 0; + text-align: center; + text-transform: uppercase; + width: 100%; + word-spacing: 2px; +} +#chat .show-more:hover { + color: #33b0f7; +} +#chat .show-more:disabled { + color: #bec5d0; + opacity: .4; + text-decoration: line-through; +} #chat .messages { display: table; width: 100%; diff --git a/client/index.html b/client/index.html index c4a0f840..4b6d13aa 100644 --- a/client/index.html +++ b/client/index.html @@ -54,7 +54,7 @@