-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavbar.js
31 lines (28 loc) · 816 Bytes
/
navbar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function login(data){
$('#profilePic').attr('src', data.profilePic);
$('#profilePicContainer').show();
$('#email').hide();
$('#password').hide();
$('#Register').hide();
$('#signIn').hide();
$('#account').show();
}
$(function() {
$('#signIn').on('click', function(){
var email = $('#email').val();
var password = $('#password').val();
if (email != "" && password != ""){
data = {
email:email,
password:password
}
socket = io.connect(metaServerUrl);
socket.emit('signIn',data);
socket.on('login',function(data){
data.name = 'NinjavsNaziCookie';
document.cookie = data;
login(data);
});
}
});
});