Force user to confirm server disconnect

This commit is contained in:
Mattias Erming 2014-05-26 01:20:16 +02:00
parent 63e3e76b39
commit 276db34c34
3 changed files with 31 additions and 33 deletions

View File

@ -208,14 +208,14 @@ button::-moz-focus-inner {
} }
#chat .title { #chat .title {
background: #ecf0f1; background: #ecf0f1;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #dbe4e6;
color: #7F8C8D; box-shadow: 0 4px rgba(0, 0, 0, .05);
color: #7f8c8d;
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
padding: 0 14px; padding: 0 14px;
} position: absolute;
#chat .sidebar .title { width: 100%;
color: #95a5a6;
} }
#chat .messages, #chat .messages,
#chat .users { #chat .users {
@ -225,6 +225,7 @@ button::-moz-focus-inner {
overflow-y: scroll; overflow-y: scroll;
position: absolute; position: absolute;
top: 44px; top: 44px;
width: 100%;
} }
#chat .messages { #chat .messages {
box-shadow: inset 140px 0 #f3f5f5; box-shadow: inset 140px 0 #f3f5f5;
@ -314,25 +315,14 @@ button::-moz-focus-inner {
} }
#chat .users { #chat .users {
padding-bottom: 6px; padding-bottom: 6px;
top: 0;
width: 156px; width: 156px;
} }
#chat .users li { #chat .users button,
display: table-row; #chat .users span {
text-align: left;
}
#chat .users .user {
padding: 4px 8px; padding: 4px 8px;
text-align: left;
} }
#chat .count { #chat .count {
background: #ecf0f1; color: #bdc3c7;
color: #aeb6bf; margin-top: 6px;
margin-bottom: 4px;
}
#chat .count span {
display: block;
padding: 10px 12px;
}
#chat .count + li .user {
padding-top: 8px
} }

View File

@ -51,26 +51,20 @@
<div id="window-{{id}}" class="window {{type}}"> <div id="window-{{id}}" class="window {{type}}">
<div class="chat"> <div class="chat">
<div class="main"> <div class="main">
<div class="title">
<h1>
{{type}}:
<strong>{{name}}</strong>
</h1>
</div>
<ul class="messages"> <ul class="messages">
<li class="show-more"> <li class="show-more">
<button class="btn">Show more</button> <button class="btn">Show more</button>
</li> </li>
{{partial "messages"}} {{partial "messages"}}
</ul> </ul>
<div class="title">
<h1>
{{type}}:
<strong>{{name}}</strong>
</h1>
</div>
</div> </div>
<aside class="sidebar"> <aside class="sidebar">
<div class="title">
<span>
Users:
{{users.length}}
</span>
</div>
<ul class="users"> <ul class="users">
{{partial "users"}} {{partial "users"}}
</ul> </ul>
@ -85,6 +79,12 @@
</script> </script>
<script type="text/html" class="users"> <script type="text/html" class="users">
<li class="count">
<span>
Users:
{{users.length}}
</span>
</li>
{{#each users}} {{#each users}}
<li> <li>
<button class="user"> <button class="user">

View File

@ -132,6 +132,14 @@ $(function() {
var cmd = "/close"; var cmd = "/close";
if (channel.hasClass("lobby")) { if (channel.hasClass("lobby")) {
cmd = "/quit"; cmd = "/quit";
var server = channel
.clone()
.remove("span")
.text()
.trim();
if (!confirm("Disconnect from " + server + "?")) {
return false;
}
} }
socket.emit("input", { socket.emit("input", {
id: id, id: id,