1

私は自分のウェブサイトでログイン システムを作成しており、そこでファイアチャットをセットアップしようとしています。そして、その #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>
4

0 に答える 0