Remember user

This commit is contained in:
Mattias Erming 2014-07-20 04:22:58 -07:00
parent 73b995931b
commit 7ac793fc89
3 changed files with 36 additions and 19 deletions

View file

@ -221,7 +221,9 @@ button {
text-align: center;
width: 220px;
}
#footer button {
#footer .icon {
color: #7c838d;
display: inline-block;
font: 16px Octicons;
line-height: 34px;
padding: 0px 12px;
@ -613,6 +615,9 @@ button {
}
@media (max-width: 480px) {
.title {
display: none;
}
.container {
margin-bottom: 5%;
}

View file

@ -26,10 +26,10 @@
You're not connected to any networks yet.
</div>
<footer id="footer">
<button class="sign-in" data-target="#sign-in" data-title="Sign in" data-placement="top" title="Sign in to Shout"></button>
<button class="connect" data-target="#connect" data-title="Connect" data-placement="top" title="Connect to network"></button>
<button class="settings" data-target="#settings" data-title="Settings" data-placement="top" title="Client settings"></button>
<button class="sign-out" data-placement="top" title="Sign out user"></button>
<button class="icon sign-in" data-target="#sign-in" data-title="Sign in" data-placement="top" title="Sign in to Shout"></button>
<button class="icon connect" data-target="#connect" data-title="Connect" data-placement="top" title="Connect to network"></button>
<button class="icon settings" data-target="#settings" data-title="Settings" data-placement="top" title="Client settings"></button>
<a href="" class="icon sign-out" data-placement="top" title="Sign out user"></a>
</footer>
</aside>
<div id="main">
@ -55,7 +55,7 @@
<div class="col-xs-12">
<label class="port">
Password
<input class="input" name="password">
<input class="input" type="password" name="password">
</label>
</div>
<div class="col-xs-12">
@ -121,32 +121,32 @@
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="join">
Show joins
<input type="checkbox" name="join">
Show joins
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="nick">
Show nick changes
<input type="checkbox" name="nick">
Show nick changes
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="part">
Show parts
<input type="checkbox" name="part">
Show parts
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="mode">
Show mode
<input type="checkbox" name="mode">
Show mode
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="quit">
Show quits
<input type="checkbox" name="quit">
Show quits
</label>
</div>
<div class="col-sm-12">
@ -154,8 +154,8 @@
</div>
<div class="col-sm-12">
<label class="opt">
<input type="checkbox" name="notification">
Enable notification sound
<input type="checkbox" name="notification">
Enable notification sound
</label>
</div>
<div class="col-sm-12">

View file

@ -35,7 +35,7 @@ $(function() {
pop.src = "/audio/pop.ogg";
$("#play").on("click", function() { pop.play(); });
$("#footer button").tooltip();
$("#footer .icon").tooltip();
var favico = new Favico({
animation: "none"
@ -59,6 +59,7 @@ $(function() {
socket.on("auth", function(data) {
$("body").addClass("signed-out");
$("#sign-in input[name='user']").val($.cookie("user") || "");
sidebar.find(".sign-in")
.click()
.end()
@ -285,6 +286,7 @@ $(function() {
var chan = $(target)
.css("z-index", top++)
.addClass("active")
.trigger("show")
.find(".chat")
.sticky();
});
@ -375,6 +377,13 @@ $(function() {
}
});
$("#windows").on("show", ".window", function() {
var self = $(this);
setTimeout(function() {
self.find("input").eq(0).focus();
}, 0);
});
$("#sign-in, #connect").on("submit", "form", function(e) {
e.preventDefault()
var event = "auth";
@ -391,6 +400,9 @@ $(function() {
values[obj.name] = obj.value;
}
});
if (values.user) {
$.cookie("user", values.user);
}
socket.emit(
event, values
);