-
Notifications
You must be signed in to change notification settings - Fork 1
/
chat.html
111 lines (108 loc) · 7.46 KB
/
chat.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<title>Debate Application</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Angular Js -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<!-- Socket IO & Jquery -->
<!-- <script src="/socket.io/socket.io.js"></script> -->
<script src="https://code.jquery.com/jquery-1.11.1.js"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js"></script> -->
<!-- -->
<!-- <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css"> -->
<!-- Angular Material requires Angular.js Libraries -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script> -->
<!-- Angular Material Library -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script> -->
<link rel="stylesheet" href="chat.css">
</head>
<body>
<div ng-app="chat_app" ng-controller="chat_controller">
<div class="container">
<div class="row">
<div class="col-md-5">
<div class="panel panel-primary">
<div class="panel-heading" id="accordion">
<span class="glyphicon glyphicon-comment"></span> Chat
<div class="btn-group pull-right">
<!-- <a type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> -->
<span class="glyphicon glyphicon-chevron-down"></span>
</a>
</div>
</div>
<!-- <div class="panel-collapse collapse" id="collapseOne"> -->
<div class="panel-body">
<ul class="chat">
<li class="left clearfix" ng-repeat="counter in display_counters track by $index">
<button id="{{'left_toggle'+$index}}" ng-click="left_toggle($index)" class="pull-left" ng-if="$index%2==1">
<</button>
<button id="{{'right_toggle'+$index}}" ng-click="right_toggle($index)" class="pull-right" ng-if="$index%2==1">></button>
<span class="chat-img pull-right" ng-if="$index%2==0"><img src="http://placehold.it/50/55C1E7/fff&text=USER" alt="User Avatar" class="img-circle" /></span>
<span class="chat-img pull-left" ng-if="$index%2==1"><img src="http://placehold.it/50/55C1E7/fff&text=MACHINE" alt="User Avatar" class="img-circle" /></span>
<div class="chat-body clearfix pull-right" ng-if="$index%2==0">
<div class="header">
<strong class="primary-font"></strong> <small class="pull-right text-muted">
<span class="glyphicon glyphicon-time"></span>12 mins ago</small>
</div>
<p>
{{counter}}<!-- , {{$index}} --> <!-- Note: this is for user searches -->
</p>
</div>
<div class="chat-body clearfix pull-left" ng-if="$index%2==1">
<div class="header">
<strong class="primary-font"></strong> <small class="pull-right text-muted">
<span class="glyphicon glyphicon-time"></span>12 mins ago</small>
</div>
<p>
{{counter.text}}<!-- , {{$index}} -->
</p>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal" ng-click="showTweets($index)">Show Tweets</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Tweets</h4>
</div>
<div class="modal-body" ng-repeat="tweet in tweets track by $index">
<p>{{tweet}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="panel-footer">
<div class="input-group">
<input id="btn-input" type="text" class="form-control input-sm" placeholder="Type your message here..." ng-model="raw_query" />
<span class="input-group-btn">
<button class="btn btn-warning btn-sm" id="btn-chat" ng-click="search()">
Send</button>
</span>
</div>
</div>
<!-- </div> -->
</div>
</div>
</div>
</div>
</div>
</body>
<script src="chat.js" type="text/javascript"></script>
</html>