-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
52 lines (50 loc) · 2.05 KB
/
index.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
<html ng-app="chat">
<head>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js" ></script>
<script type="text/javascript" src="bower_components/angular-route/angular-route.js" ></script>
<script type="text/javascript" src="js/chat.js" ></script>
<script type="text/javascript" src="js/connection.js" ></script>
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.css">
<title>Chat!</title>
</head>
<body ng-controller="chat">
<div class="well text-center">
<form class="form-inline" ng-submit="connect()" ng-show="!connected">
<label>Nickname? </label>
<input class="form-control" type="text" ng-model="nickname">
<button type="submit" class="btn btn-primary" >Connect</button>
</form>
<h4 ng-show="connected">Connected as {{nickname}}</h4>
</div>
<div class="container" ng-show="connected">
<div class="header">
<h3 class="text-muted">Chat</h3>
</div>
<div class="row">
<div class="col-xs-8">
<div class="well" style="height:50%; overflow:scroll">
<ul>
<li ng-repeat="message in messages">
<p><span class="text-primary" >{{message.nickname}}: </span>{{message.message}}</p>
</li>
</ul>
<div id="bottom"></div>
</div>
<form class="form-inline" ng-submit="send_message()">
<div class="form-group col-xs-11">
<input type="text" class="form-control" placeholder="type..." style="width:100%;" ng-model="message">
</div>
<button type="submit" class="btn btn-primary">send</button>
</form>
</div>
<div class=" col-xs-4" style="height:50%; overflow:scroll">
<span>Users Connected</span>
<ul>
<li ng-repeat="user in users">{{user}}</li>
</ul>
</div>
</div>
</div>
</body>
</html>