Clickable users

This commit is contained in:
Mattias Erming 2014-04-09 22:54:04 +02:00
parent da74cdece4
commit 541e41e804
3 changed files with 17 additions and 10 deletions

View File

@ -11,9 +11,14 @@ h2 {
font: inherit; font: inherit;
margin: 0; margin: 0;
} }
.nav > li > a:hover { .nav a[data-toggle]:hover {
background: #f9f9f9; background: #f9f9f9;
} }
.user {
color: #f00;
cursor: pointer;
-webkit-user-select: none;
}
#wrap, #wrap,
#viewport { #viewport {
height: 100%; height: 100%;
@ -184,7 +189,7 @@ h2 {
padding: 0 8px; padding: 0 8px;
} }
#chat .messages { #chat .messages {
border-left: 8px solid #fafafa; border-left: 8px solid #f7f7f9;
bottom: 30px; bottom: 30px;
left: 0; left: 0;
overflow-y: auto; overflow-y: auto;
@ -205,9 +210,6 @@ h2 {
#chat .message .time { #chat .message .time {
color: #bbb; color: #bbb;
} }
#chat .message .user {
color: #f00;
}
#chat .message .type, #chat .message .type,
#chat .message .text { #chat .message .text {
color: inherit; color: inherit;

View File

@ -99,9 +99,9 @@
</script> </script>
<script type="text/html" id="user"> <script type="text/html" id="user">
{{#users}} {{#users}}
<a href="{{name}}" class="user"> <div class="user">
{{mode}}{{name}} {{name}}
</a> </div>
{{/users}} {{/users}}
</script> </script>
<script type="text/html" id="message"> <script type="text/html" id="message">

View File

@ -215,8 +215,13 @@ $(function() {
}); });
}); });
chat.on("click", ".user", function(e) { chat.on("dblclick", ".user", function() {
e.preventDefault(); var link = $(this);
var id = parseInt(link.closest(".window").attr("id").replace("window-", ""));
socket.emit("input", {
id: id,
text: "/whois " + link.text(),
});
}); });
chat.on("focus", "input[type=text]", function() { chat.on("focus", "input[type=text]", function() {