Added 'Close' button

This commit is contained in:
Mattias Erming 2014-09-21 08:59:50 -07:00
parent 0607516872
commit 9edaf6a2e4
6 changed files with 50 additions and 7 deletions

View File

@ -399,6 +399,23 @@ button {
margin-left: 8px; margin-left: 8px;
text-transform: capitalize; 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 { #windows .window .header {
display: none; display: none;
} }
@ -812,6 +829,9 @@ button {
#viewport .channel .rt { #viewport .channel .rt {
display: block; display: block;
} }
#viewport .rt {
margin-left: 18px;
}
#windows .window .header { #windows .window .header {
display: block; display: block;
} }

View File

@ -235,7 +235,6 @@
</div> </div>
<form id="form" action=""> <form id="form" action="">
<div class="inner"> <div class="inner">
<!--<input id="submit" tabindex="-1" type="submit">-->
<button id="submit" type="submit"> <button id="submit" type="submit">
Send Send
</button> </button>

View File

@ -224,7 +224,6 @@ $(function() {
socket.on("part", function(data) { socket.on("part", function(data) {
var id = data.chan; var id = data.chan;
console.log(id);
sidebar.find(".chan[data-id='" + id + "']").remove(); sidebar.find(".chan[data-id='" + id + "']").remove();
$("#chan-" + 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) { chat.on("msg", ".messages", function(e, target, msg) {
var button = sidebar.find(".chan[data-target=" + target + "]"); var button = sidebar.find(".chan[data-target=" + target + "]");
var isQuery = button.hasClass("query"); var isQuery = button.hasClass("query");

View File

@ -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))) + 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 " + "\" 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))) + 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 <div class=\"header\">\n <button class=\"lt\"></button>\n <button class=\"rt\"></button>\n <span class=\"title\">" + "\">\n <div class=\"header\">\n <button class=\"lt\"></button>\n <button class=\"rt\"></button>\n <div class=\"right\">\n <button class=\"button close\">\n";
stack1 = ((helpers.equal || (depth0 && depth0.equal) || helperMissing).call(depth0, (depth0 != null ? depth0.type : depth0), "lobby", {"name":"equal","hash":{},"fn":this.program(2, data),"inverse":this.program(4, data),"data":data}));
if (stack1 != null) { buffer += stack1; }
buffer += " </button>\n </div>\n <span class=\"title\">"
+ 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))) + 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)))
+ "</span>\n <span class=\"topic\">" + "</span>\n <span class=\"topic\">"
+ 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))) + 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)))
+ " </span>\n </div>\n <div class=\"chat\">\n"; + " </span>\n </div>\n <div class=\"chat\">\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; } if (stack1 != null) { buffer += stack1; }
return buffer + " <div class=\"messages\">\n " return buffer + " <div class=\"messages\">\n "
+ escapeExpression(((helpers.partial || (depth0 && depth0.partial) || helperMissing).call(depth0, "msg", {"name":"partial","hash":{},"data":data}))) + 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}))) + escapeExpression(((helpers.partial || (depth0 && depth0.partial) || helperMissing).call(depth0, "user", {"name":"partial","hash":{},"data":data})))
+ "\n </div>\n </aside>\n</div>\n"; + "\n </div>\n </aside>\n</div>\n";
},"2":function(depth0,helpers,partials,data) { },"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; var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <button class=\"show-more\" data-id=\"" return " <button class=\"show-more\" data-id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))
+ "\">\n Show more\n </button>\n"; + "\">\n Show more\n </button>\n";
},"4":function(depth0,helpers,partials,data) { },"8":function(depth0,helpers,partials,data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <button class=\"show-more hidden\" data-id=\"" return " <button class=\"show-more hidden\" data-id=\""
+ escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper))) + escapeExpression(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"id","hash":{},"data":data}) : helper)))

View File

@ -3,11 +3,20 @@
<div class="header"> <div class="header">
<button class="lt"></button> <button class="lt"></button>
<button class="rt"></button> <button class="rt"></button>
<div class="right">
<button class="button close">
{{#equal type "lobby"}}
Disconnect
{{else}}
Leave
{{/equal}}
</button>
</div>
<span class="title">{{name}}</span> <span class="title">{{name}}</span>
<span class="topic">{{type}} </span> <span class="topic">{{type}} </span>
</div> </div>
<div class="chat"> <div class="chat">
{{#equal 100 messages.length}} {{#equal messages.length 100}}
<button class="show-more" data-id="{{id}}"> <button class="show-more" data-id="{{id}}">
Show more Show more
</button> </button>

View File

@ -1,7 +1,7 @@
{ {
"name": "shout", "name": "shout",
"description": "A web IRC client", "description": "A web IRC client",
"version": "0.31.7", "version": "0.31.8",
"author": "Mattias Erming", "author": "Mattias Erming",
"preferGlobal": true, "preferGlobal": true,
"bin": { "bin": {