-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
80 lines (78 loc) · 4.4 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
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
<head>
<title>Firebase 即時聊天測試</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/js/bootstrap.min.js" type="text/javascript"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://www.gstatic.com/firebasejs/3.6.4/firebase.js"></script>
<script src="model.js"></script>
<script src="controller.js"></script>
<style>
body {
background-color: #ccc;
}
</style>
</head>
<body ng-app="FirebaseChat">
<div class="container">
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="row">
<div class="panel panel-primary" ng-controller="ChatController" id="test">
<div class="panel-heading" style="padding:0 0 0 8px;">
<span class="glyphicon glyphicon-user"></span>
<h6 class="panel-title" style="display:inline;">Firebase 即時資料測試</h6>
<div class="btn-group btn-group-xs pull-right">
<button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-lock"></span></button>
<button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-cog"></span></button>
<button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-remove"></span></button>
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body" style="padding:0 4px;" id="panelBody">
<div class="row">
<div class="col-xs-12" style="max-height:500px;max-width:80%;overflow-y:auto;overflow-x:hidden;" id="scrollPanel">
<table class="table table-hover table-condensed" style="">
<tr ng-hide="chatMessages.length === 0" ng-repeat="chat in chatMessages | orderBy:'time'" style="min-width:100%;max-width:100%;width:100%;">
<td>
<h4>{{chat.username}}</h4>
</td>
<td>
<p class="word-wrap:break-word">{{chat.text}}</p>
</td>
<td>
<p> <small>{{chat.time | date:'yyyy年M月dd日 hh:mm'}}</small></p>
</td>
</tr>
<tr ng-show="chatMessages.length === 0">
<td>
<p>開始聊天吧!</p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="panel-footer">
<form>
<div class="input-group input-group-sm">
<span class="input-group-addon">
<img src="http://placehold.it/16x16" alt="" />
</span>
<input type="text" class="form-control" ng-model="username" placeholder="輸入名稱" />
<input type="text" class="form-control" ng-model="newChatMsg" placeholder="輸入訊息" />
<span class="input-group-btn">
<button class="btn btn-primary" type="submit" ng-click="addChat()">傳送</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>