-
Notifications
You must be signed in to change notification settings - Fork 0
/
room.html
93 lines (86 loc) · 2.95 KB
/
room.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/styles.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/ajaxFunctions.js"></script>
<title>Chat Room</title>
<script>
var ids = {},
cId;
$(document).ready(function(){
getChat();
getUsers();
$('#sendChat').click(function(){
sendChatAjax($('#chatText').val(), 1);
// var chatText = $('#chatText').val();
if(!chatText){
//form validation
console.log("no chat data");
}
else {
$('#chatText').val("");
}
});
$('#logout').click(function(){
ajaxCall("GET", {method:"logout", a:"login"}, callbackLogout);
});
});
</script>
</head>
<body>
<div class="container">
<div class="row " style="padding-top:40px;">
<div class="col-md-8">
<div class="panel panel-info">
<div class="panel-heading">
Battleship Main Chat Room
</div>
<div class="panel-body" id="chat_cont">
<ul class="media-list" id="chat_body">
<!--messages dynamically added here-->
</ul>
</div>
<div class="panel-footer">
<div class="input-group">
<input type="text" class="form-control" placeholder="Enter Message" name="chatText" id="chatText" />
<span class="input-group-btn">
<button class="btn btn-info" type="button" name="sendChat" id="sendChat">SEND</button>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
ONLINE USERS
<p>Click username to Challenge</p>
<div class="input-group">
<span class="input-group-btn">
<button type="button" name="logout" id="logout" class="btn btn-warning pull-right" >LOG OUT</button>
</span>
</div>
</div>
<div class="panel-body">
<ul class="media-list" id="active_users">
</ul>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">
Challenges
</div>
<!--set id of challenge as id of div???-->
<div class="panel-body">
<ul class="media-list" id="challenge_list">
</ul>
</div>
</div>
</div>
</div>
</div>
</body>
</html>