-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
224 lines (188 loc) · 7.89 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Four Column Portfolio Template for Bootstrap 3</title>
<!-- Bootstrap core CSS -->
<link href="stylesheets/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS for the '4 Col Portfolio' Template -->
<link href="stylesheets/4-col-portfolio.css" rel="stylesheet">
<link href="styles/main.css" rel="stylesheet">
</head>
<body>
<script id='postTemplate' type='text/x-jquery-tmpl'>
<div class="col-md-4 portfolio-item">
<a href="portfolio-item.html">
<img class="img-responsive dp img-circle" src="http://lorempixel.com/180/180/">
</a>
<h4 class="media-heading">${subject}</h4>
<h5>${date}</h5>
<button id="subject" data-id="${id}" class="btn btn-success">Read More</button>
</div>
</script>
<script id='chatTemplate' type='text/x-jquery-tmpl'>
<li class="left clearfix"><span class="chat-img pull-left">
<img src="http://placehold.it/50/55C1E7/fff&text=U" alt="User Avatar" class="img-circle">
</span>
<div class="chat-body clearfix">
<div class="header">
<strong class="primary-font">${username}</strong> <small class="pull-right text-muted">
<span class="glyphicon glyphicon-time"></span>14 mins ago</small>
</div>
<p>
${message}
</p>
</div>
</li>
</script>
<nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://startbootstrap.com">My Booklog</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a href="#about">關於</a>
</li>
<li><a href="#services">所有文章</a>
</li>
<li><a href="#contact">張貼文章</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">最新訊息
<small>Showcase Your Work</small>
</h1>
</div>
</div>
<div class="row">
<div class="col-md-5">
<div class="panel panel-primary">
<div class="panel-heading">
<span class="glyphicon glyphicon-comment"></span> Chat
<div class="btn-group pull-right">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-chevron-down"></span>
</button>
<ul class="dropdown-menu slidedown">
<li><a href="http://www.jquery2dotnet.com"><span class="glyphicon glyphicon-refresh">
</span>Refresh</a></li>
<li><a href="http://www.jquery2dotnet.com"><span class="glyphicon glyphicon-ok-sign">
</span>Available</a></li>
<li><a href="http://www.jquery2dotnet.com"><span class="glyphicon glyphicon-remove">
</span>Busy</a></li>
<li><a href="http://www.jquery2dotnet.com"><span class="glyphicon glyphicon-time"></span>
Away</a></li>
<li class="divider"></li>
<li><a href="http://www.jquery2dotnet.com"><span class="glyphicon glyphicon-off"></span>
Sign Out</a></li>
</ul>
</div>
</div>
<div class="panel-body">
<ul class="chat">
</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...">
<span class="input-group-btn">
<button class="btn btn-warning btn-sm" id="btn-chat">
Send</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div id="message"></div>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">最新文章
<small>Showcase Your Work</small>
</h1>
</div>
</div>
<div class="row" id="content">
</div>
<hr>
<div class="row text-center">
<div class="col-lg-12">
<ul class="pagination">
<li><a href="#">«</a>
</li>
<li class="active"><a href="#">1</a>
</li>
<li><a href="#">2</a>
</li>
<li><a href="#">3</a>
</li>
<li><a href="#">4</a>
</li>
<li><a href="#">5</a>
</li>
<li><a href="#">»</a>
</li>
</ul>
</div>
</div>
</div>
<!-- /.container -->
<div class="container">
<hr>
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © Company 2013</p>
</div>
</div>
</footer>
</div>
<!-- /.container -->
<!-- JavaScript -->
<script src="javascripts/jquery.min.js"></script>
<script src="javascripts/bootstrap.min.js"></script>
<script src='javascripts/jquery-tmpl/jquery.tmpl.min.js'></script>
<script src='javascripts/main.js'></script>
<script src='javascripts/jquery.websocket.js'></script>
<script type="text/javascript">
$(document).ready(function(){
$("#message").createWebSocket();
initSubmitForm();
});
var initSubmitForm = function () {
$("#btn-chat").on('click', function () {
$.ajax({
url: "http://192.168.1.24:8080/send",
type: "GET",
dataType: "json",
data: {
m: $("#btn-input").val(),
u: 'jollen',
},
});
return false;
});
};
</script>
</body>
</html>