Commit 6881f2ba authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent b78e095d
...@@ -130,15 +130,15 @@ login = -> ...@@ -130,15 +130,15 @@ login = ->
#window.onunload = window.onbeforeunload #window.onunload = window.onbeforeunload
window.onbeforeunload = null window.onbeforeunload = null
candy_height = $('#candy').outerHeight true
$('.card_center').css('margin-bottom', -candy_height)
$('.card_center').css('padding-bottom', candy_height)
$('#candy').show() $('#candy').show()
$('.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)
$('#roster').show() $('#roster').show()
$('#username').html Candy.Util.getCookie('username')
$('.me').toggle()
logout = -> logout = ->
Candy.Util.deleteCookie('jid') Candy.Util.deleteCookie('jid')
Candy.Util.deleteCookie('username') Candy.Util.deleteCookie('username')
...@@ -147,8 +147,13 @@ logout = -> ...@@ -147,8 +147,13 @@ logout = ->
$(document).ready -> $(document).ready ->
#stroll.bind( '.online_list ul' ); #stroll.bind( '.online_list ul' );
if Candy.Util.getCookie('jid') if Candy.Util.getCookie('jid')
login() login()
if Candy.Util.getCookie('password')
$('#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,
......
...@@ -179,6 +179,7 @@ ...@@ -179,6 +179,7 @@
})(Spine.Controller); })(Spine.Controller);
login = function() { login = function() {
var candy_height;
Candy.init('http://s70.hebexpo.com:5280/http-bind/', { Candy.init('http://s70.hebexpo.com:5280/http-bind/', {
core: { core: {
debug: false, debug: false,
...@@ -216,13 +217,14 @@ ...@@ -216,13 +217,14 @@
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; window.onbeforeunload = null;
candy_height = $('#candy').outerHeight(true);
$('.card_center').css('margin-bottom', -candy_height);
$('.card_center').css('padding-bottom', candy_height);
$('#candy').show(); $('#candy').show();
$('.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);
}); });
$('#roster').show(); return $('#roster').show();
$('#username').html(Candy.Util.getCookie('username'));
return $('.me').toggle();
}; };
logout = function() { logout = function() {
...@@ -236,6 +238,11 @@ ...@@ -236,6 +238,11 @@
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')) {
$('#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,
......
...@@ -48,14 +48,14 @@ body { ...@@ -48,14 +48,14 @@ body {
} }
} }
.me { .log_reg {
/*float:right;*/ /*float:right;*/
font-size: 12px; font-size: 12px;
padding: 34px 25px 0 0; padding: 34px 25px 0 0;
a { a {
color: #666666; color: #666666;
text-decoration: none; text-decoration: none;
&.login { &.logging_button {
color: #147CC3; color: #147CC3;
} }
} }
...@@ -65,9 +65,9 @@ body { ...@@ -65,9 +65,9 @@ body {
} }
/*中央*/ /*中央*/
.card_center { /*.card_center {
padding: 20px; padding: 20px;
} } */
#rooms { #rooms {
/*float:left;*/ /*float:left;*/
...@@ -135,20 +135,20 @@ html, body { ...@@ -135,20 +135,20 @@ html, body {
height: 100%; height: 100%;
} }
.card_top{
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.card_center { .card_center {
padding-top: 300px; padding-top: 80px;
margin-top: -300px; margin-top: -80px;
padding-bottom: 41px;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
#rooms { #rooms {
height: 100%; height: 100%;
overflow: hidden; overflow-y: auto;
&:hover {
overflow-y: auto;
}
} }
.online_list { .online_list {
height: 100%; height: 100%;
...@@ -203,14 +203,14 @@ html, body { ...@@ -203,14 +203,14 @@ html, body {
} }
/*登陆按钮*/ /*登陆按钮*/
#login_button { .logging_button {
cursor: pointer cursor: pointer
} }
/*登陆窗*/ /*登陆窗*/
/*
#login{ /*#login{
#login_node {width:80px} #node {width:80px}
.ui-combobox-input {width: 100px} .ui-combobox-input {width: 100px}
.ui-combobox-toggle {width: auto} .ui-combobox-toggle {width: auto}
} */ } */
...@@ -218,6 +218,9 @@ html, body { ...@@ -218,6 +218,9 @@ html, body {
#node { #node {
width: 60px; width: 60px;
} }
label{
width: 96px;
}
label[for=domain] { label[for=domain] {
width: auto; width: auto;
clear: none; clear: none;
......
...@@ -36,19 +36,25 @@ ...@@ -36,19 +36,25 @@
</script> </script>
<script id="login_form_template" type="text/x-mustache-template"> <script id="login_form_template" type="text/x-mustache-template">
<form method="post" id="login-form" class="login-form" onsubmit="{{#displayUsername}}username.value = node.value + '@' + domain.value;{{/displayUsername}}Candy.Util.setCookie('jid', username.value, 365);Candy.Util.setCookie('username', node.value, 365);Candy.Util.setCookie('password', password.value, 365)"> <form method="post" id="login-form" class="login-form" onsubmit="
{{#displayUsername}}username.value = node.value + '@' + domain.value;{{/displayUsername}}
Candy.Util.setCookie('jid', username.value, 365);
Candy.Util.setCookie('username', node.value, 365);
Candy.Util.setCookie('password', password.value, 365);
$('#current_username').html(username.value);
$('.log_reg.not_logged').hide();
$('.log_reg.logged').show();">
{{#displayUsername}} {{#displayUsername}}
<label for="login_node">{{_labelUsername}}</label> <label for="node">{{_labelUsername}}</label>
<input type="text" id="login_node" name="node"/> <input type="text" id="node" name="node"/>
<label for="login_domain">@</label> <label for="domain">@</label>
<select id="login_domain" name="domain" tabindex="-1"> <select id="domain" name="domain" tabindex="-1">
<option label="my-card.in" value="my-card.in" selected="selected"/> <option label="my-card.in" value="my-card.in" selected="selected"/>
<option label="gmail.com" value="gmail.com"/> <option label="gmail.com" value="gmail.com"/>
</select> </select>
{{/displayUsername}} {{/displayUsername}}
<input type="hidden" id="login_username" name="username" value="{{presetJid}}"/> <input type="hidden" id="username" name="username" value="{{presetJid}}"/>
{{#displayPassword}}<label for="login_password">{{_labelPassword}}</label><input type="password" id="login_password" name="password"/>{{/displayPassword}} {{#displayPassword}}<label for="password">{{_labelPassword}}</label><input type="password" id="password" name="password"/>{{/displayPassword}}
<input type="submit" class="button" value="{{_loginSubmit}}"/> <input type="submit" class="button" value="{{_loginSubmit}}"/>
</form> </form>
</script> </script>
...@@ -91,20 +97,20 @@ ...@@ -91,20 +97,20 @@
<select id="servers" multiple="multiple"></select> <select id="servers" multiple="multiple"></select>
<input id="new_room_button" type="button" value="建立房间"/> <input id="new_room_button" type="button" value="建立房间"/>
</div> </div>
<div class="me"> <div class="log_reg not_logged">
<a href="http://my-card.in/register">注册</a> <a href="http://my-card.in/register">注册</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a id="login_button" class="login">登录</a> <a id="login_button" class="logging_button">登录</a>
</div> </div>
<div class="me" style="display: none;"> <div class="log_reg logged" style="display: none;">
<a id="username"></a> <a id="current_username"></a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a id="logout_button" class="login">退出</a> <a id="logout_button" class="logging_button">退出</a>
</div> </div>
</div> </div>
<div class="card_center"> <div class="card_center">
<div id="rooms"></div> <div id="rooms"></div>
<div class="online_list"> <div class="online_list" style="display: none;">
<div class="online_title">聊天工具</div> <div class="online_title">聊天工具</div>
<ul id="roster"> <ul id="roster">
<li> <li>
......
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