From 9edaf6a2e44e318daa960c49ac5ed110ed8458ab Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Sun, 21 Sep 2014 08:59:50 -0700 Subject: [PATCH] Added 'Close' button --- client/css/style.css | 20 ++++++++++++++++++++ client/index.html | 1 - client/js/shout.js | 10 +++++++++- client/js/shout.templates.js | 13 ++++++++++--- client/templates/chat.tpl | 11 ++++++++++- package.json | 2 +- 6 files changed, 50 insertions(+), 7 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index 99f9588..64623e5 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -399,6 +399,23 @@ button { margin-left: 8px; text-transform: capitalize; } +#windows .header .right { + float: right; + margin-right: -10px; + margin-top: -2px; +} +#windows .header .button { + background: #f4f4f4; + background-image: linear-gradient(#f4f4f4, #ececec); + border: 1px solid #d7d7d7; + border-bottom-color: #b7b7b7; + border-radius: 2px; + color: #555; + font: 12px Lato, sans-serif; + height: 25px; + line-height: 0; + padding: 0 10px; +} #windows .window .header { display: none; } @@ -812,6 +829,9 @@ button { #viewport .channel .rt { display: block; } + #viewport .rt { + margin-left: 18px; + } #windows .window .header { display: block; } diff --git a/client/index.html b/client/index.html index 8d82b2a..7d26e94 100644 --- a/client/index.html +++ b/client/index.html @@ -235,7 +235,6 @@
- diff --git a/client/js/shout.js b/client/js/shout.js index 181f083..0fa7720 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -224,7 +224,6 @@ $(function() { socket.on("part", function(data) { var id = data.chan; - console.log(id); sidebar.find(".chan[data-id='" + id + "']").remove(); $("#chan-" + id).remove(); @@ -465,6 +464,15 @@ $(function() { }); }); + chat.on("click", ".close", function() { + var id = $(this) + .closest(".chan") + .data("id"); + sidebar.find(".chan[data-id='" + id + "']") + .find(".close") + .click(); + }); + chat.on("msg", ".messages", function(e, target, msg) { var button = sidebar.find(".chan[data-target=" + target + "]"); var isQuery = button.hasClass("query"); diff --git a/client/js/shout.templates.js b/client/js/shout.templates.js index 2ad5a5d..94a6ae3 100644 --- a/client/js/shout.templates.js +++ b/client/js/shout.templates.js @@ -28,12 +28,15 @@ templates['chat'] = template({"1":function(depth0,helpers,partials,data) { + escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper))) + "\" class=\"chan " + escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper))) - + "\">\n
\n \n \n " + + "\">\n
\n \n \n
\n \n
\n " + escapeExpression(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"name","hash":{},"data":data}) : helper))) + "\n " + escapeExpression(((helper = (helper = helpers.type || (depth0 != null ? depth0.type : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"type","hash":{},"data":data}) : helper))) + " \n
\n
\n"; - stack1 = ((helpers.equal || (depth0 && depth0.equal) || helperMissing).call(depth0, 100, ((stack1 = (depth0 != null ? depth0.messages : depth0)) != null ? stack1.length : stack1), {"name":"equal","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data})); + stack1 = ((helpers.equal || (depth0 && depth0.equal) || helperMissing).call(depth0, ((stack1 = (depth0 != null ? depth0.messages : depth0)) != null ? stack1.length : stack1), 100, {"name":"equal","hash":{},"fn":this.program(6, data),"inverse":this.program(8, data),"data":data})); if (stack1 != null) { buffer += stack1; } return buffer + "
\n " + escapeExpression(((helpers.partial || (depth0 && depth0.partial) || helperMissing).call(depth0, "msg", {"name":"partial","hash":{},"data":data}))) @@ -41,11 +44,15 @@ templates['chat'] = template({"1":function(depth0,helpers,partials,data) { + escapeExpression(((helpers.partial || (depth0 && depth0.partial) || helperMissing).call(depth0, "user", {"name":"partial","hash":{},"data":data}))) + "\n
\n \n
\n"; },"2":function(depth0,helpers,partials,data) { + return " Disconnect\n"; + },"4":function(depth0,helpers,partials,data) { + return " Leave\n"; + },"6":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return " \n"; -},"4":function(depth0,helpers,partials,data) { +},"8":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return " +
+ +
{{name}} {{type}}
- {{#equal 100 messages.length}} + {{#equal messages.length 100}} diff --git a/package.json b/package.json index ee4ae53..cfe77c0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "A web IRC client", - "version": "0.31.7", + "version": "0.31.8", "author": "Mattias Erming", "preferGlobal": true, "bin": {