我的网站上已经完成了登录系统,我正在尝试设置firechat。 我想知道在哪里删除#modal并制作
username = <?php echo $login->username; ?>
已删除简单登录脚本文件。
<script>
var chatRef = new Firebase('https://xxxxxxx.firebaseio.com/fire'),
target = document.getElementById("firechat-container"),
authModal = $('#auth-modal').modal({ show: false }),
chat = new FirechatUI(chatRef, target);
chat.on('auth-required', function() {
authModal.modal('show');
return false;
});
var auth = new FirebaseSimpleLogin(chatRef, function(error, user) {
if (user) {
var userId = user.id,
username = user.displayName;
chat.setUser(user.id, username);
$('#user-name').text(username);
$('#user-info').show();
setTimeout(function() {
chat._chat.enterRoom('-Iy1N3xs4kN8iALHV0QA')
}, 500);
} else {
$('#user-info').hide();
chat._chat.enterRoom('-Iy1N3xs4kN8iALHV0QA')
}
});
function login(provider) {
authModal.modal('hide');
auth.login(provider);
}
function logout() {
auth.logout();
location.reload();
}
</script>