Commit 7827058a authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 6881f2ba
...@@ -128,16 +128,19 @@ login = -> ...@@ -128,16 +128,19 @@ login = ->
$('.xmpp').click -> $('.xmpp').click ->
Candy.View.Pane.PrivateRoom.open($(this).data('jid'), $(this).data('nick'), true, true) Candy.View.Pane.PrivateRoom.open($(this).data('jid'), $(this).data('nick'), true, true)
#window.onunload = window.onbeforeunload $('#candy').show()
window.onbeforeunload = null
candy_height = $('#candy').outerHeight true candy_height = $('#candy').outerHeight true
$('.card_center').css('margin-bottom', -candy_height) $('.card_center').css('margin-bottom', -candy_height)
$('.card_center').css('padding-bottom', candy_height) $('.card_center').css('padding-bottom', candy_height)
$('#candy').show() #window.onunload = window.onbeforeunload
window.onbeforeunload = null
$('.xmpp').click -> @after_login = ->
Candy.View.Pane.PrivateRoom.open($(this).data('jid'), $(this).data('nick'), true, true) $('.online_list').show()
$('#roster').show()
$('#current_username').html(Candy.Util.getCookie('username'))
$('.log_reg.not_logged').hide()
$('.log_reg.logged').show()
logout = -> logout = ->
Candy.Util.deleteCookie('jid') Candy.Util.deleteCookie('jid')
...@@ -150,10 +153,8 @@ $(document).ready -> ...@@ -150,10 +153,8 @@ $(document).ready ->
if Candy.Util.getCookie('jid') if Candy.Util.getCookie('jid')
login() login()
if Candy.Util.getCookie('password') after_login()
$('#current_username').html(Candy.Util.getCookie('username'));
$('.log_reg.not_logged').hide();
$('.log_reg.logged').show();
$('#new_room_dialog').dialog $('#new_room_dialog').dialog
autoOpen:false, autoOpen:false,
......
...@@ -216,15 +216,18 @@ ...@@ -216,15 +216,18 @@
$('.xmpp').click(function() { $('.xmpp').click(function() {
return Candy.View.Pane.PrivateRoom.open($(this).data('jid'), $(this).data('nick'), true, true); return Candy.View.Pane.PrivateRoom.open($(this).data('jid'), $(this).data('nick'), true, true);
}); });
window.onbeforeunload = null; $('#candy').show();
candy_height = $('#candy').outerHeight(true); candy_height = $('#candy').outerHeight(true);
$('.card_center').css('margin-bottom', -candy_height); $('.card_center').css('margin-bottom', -candy_height);
$('.card_center').css('padding-bottom', candy_height); $('.card_center').css('padding-bottom', candy_height);
$('#candy').show(); return window.onbeforeunload = null;
$('.xmpp').click(function() { };
return Candy.View.Pane.PrivateRoom.open($(this).data('jid'), $(this).data('nick'), true, true);
}); this.after_login = function() {
return $('#roster').show(); $('.online_list').show();
$('#current_username').html(Candy.Util.getCookie('username'));
$('.log_reg.not_logged').hide();
return $('.log_reg.logged').show();
}; };
logout = function() { logout = function() {
...@@ -238,11 +241,7 @@ ...@@ -238,11 +241,7 @@
var new_room, rooms, servers; var new_room, rooms, servers;
if (Candy.Util.getCookie('jid')) { if (Candy.Util.getCookie('jid')) {
login(); login();
if (Candy.Util.getCookie('password')) { after_login();
$('#current_username').html(Candy.Util.getCookie('username'));
$('.log_reg.not_logged').hide();
$('.log_reg.logged').show();
}
} }
$('#new_room_dialog').dialog({ $('#new_room_dialog').dialog({
autoOpen: false, autoOpen: false,
......
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
Candy.Util.setCookie('jid', username.value, 365); Candy.Util.setCookie('jid', username.value, 365);
Candy.Util.setCookie('username', node.value, 365); Candy.Util.setCookie('username', node.value, 365);
Candy.Util.setCookie('password', password.value, 365); Candy.Util.setCookie('password', password.value, 365);
$('#current_username').html(username.value); after_login();">
$('.log_reg.not_logged').hide();
$('.log_reg.logged').show();">
{{#displayUsername}} {{#displayUsername}}
<label for="node">{{_labelUsername}}</label> <label for="node">{{_labelUsername}}</label>
<input type="text" id="node" name="node"/> <input type="text" id="node" name="node"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment