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

fix

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