From dcd72b2345fae81a026798daecfb8d952f2e19d1 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Sat, 22 Mar 2014 20:23:48 +0100 Subject: [PATCH] Save settings in a cookie --- .gitignore | 1 - client/css/style.css | 15 +++++++++++---- client/index.html | 1 + client/js/chat.js | 32 ++++++++++++++++++++++++++++---- 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a33af08..c2658d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ node_modules/ -config.js diff --git a/client/css/style.css b/client/css/style.css index 912b80b..84acfdd 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -99,12 +99,19 @@ h2 { padding: 0 10px; width: 100%; } -#chat.hide-join .join, -#chat.hide-part .part, -#chat.hide-nick .nick, -#chat.hide-quit .quit { +#chat .join, +#chat .part, +#chat .nick, +#chat .quit { + /* Hidden by default */ display: none; } +#chat.show-join .join, +#chat.show-part .part, +#chat.show-nick .nick, +#chat.show-quit .quit { + display: block; +} #chat .window { background: #fff; display: none; diff --git a/client/index.html b/client/index.html index dbe2dd3..9e81d0f 100644 --- a/client/index.html +++ b/client/index.html @@ -118,6 +118,7 @@ + diff --git a/client/js/chat.js b/client/js/chat.js index ed9a9fa..c0231bb 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -14,7 +14,7 @@ $(function() { tpl[id] = tpl[id] || $(id).html(); if (!json) { // If no data is supplied, return the template instead. - // Used when fetching partials. + // Handy when fetching partials. return tpl[id]; } return Mustache.render( @@ -123,11 +123,35 @@ $(function() { sidebar.find("input[type=checkbox]").each(function() { var input = $(this); var value = input.val(); - input.prop("checked", true).wrap("