-
Notifications
You must be signed in to change notification settings - Fork 1
/
stackoverflow.html
64 lines (64 loc) · 2.64 KB
/
stackoverflow.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
<!doctype html>
<!-- views/profile.ejs -->
<html>
<head>
<title>Node Authentication</title>
<link rel="stylesheet" href="/stylesheets/style.css"/>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body {
padding-top: 80px;
word-wrap: break-word;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body ng-app="app">
<script src="/socket.io/socket.io.js"></script>
<script>
// on load of page
$(function() {
// when the client clicks SEND
$('#datasend').click(function() {
console.log('enviar data');
var message = $('#data').val();
text = $('<span></span>').text(message);
user = $('<b> </b>').text('me: ');
div = $('<div> </div>');
div = div.append(user);
div = div.append(text);
$('#conversation').append(message);
$('#data').val('');
});
// when the client hits ENTER on their keyboard
$('#data').keypress(function(e) {
if (e.which == 13) {
$(this).blur();
$('#datasend').focus().click();
}
});
});
</script>
<script src="scripts/locate.js"></script>
<div class="container" ng-controller="userController">
<div class="row">
<div class="col-sm-12">
<div class="well">
<h3>
<span class="fa fa-comment"></span>
Chat</h3>
<div>
<div id="conversation"></div>
<input id="data" style="width:200px;"/>
<input type="button" id="datasend" value="send"/>
</div>
</div>
</div>
</div>
</div>
</body>
</html>