-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
58 lines (56 loc) · 2.31 KB
/
index.html
File metadata and controls
58 lines (56 loc) · 2.31 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Welcome!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/assets/css/style.css" media="screen">
<link rel="stylesheet" href="/assets/css/livechat.css" media="screen">
<meta name="robots" content="noindex" />
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="http://livechatjs.com:8000/nowjs/now.js"></script>
</head>
<body>
<div class="wrapper">
<header>
<h1>Node.js Livechat messanger</h1>
</header>
<section>
<h2>This page is a sample client facing page</h2>
<form>
<label for="lc_name">Name</label>
<input id="lc_name" name="lc_name" type="text" placeholder="your name">
<label for="lc_email">E-mail Address</label>
<input id="lc_email" name="lc_email" type="email" placeholder="user@email.com">
<button id='livehelp'>I need Help</button>
</form>
</section>
<footer>
<p>Powered by Node.js, express, now.js, jquery and jquery UI</p>
</footer>
</div>
</body>
<script>
$(document).ready(function(){
$('#livehelp').click(function(e){
e.preventDefault();
var email = $('#lc_email').val();
var name = $('#lc_name').val();
var dept = null;
now.clientlogin(email,name,dept);
var r = '<div id="messages"><div style="position:absolute;bottom:25px;"></div><input id="text-input" type="text"><input id="send-button" type="button" value="send"></div>';
$('section form').detach();
$('section').append(r);
})
now.receiveMessage = function(name, message,groupname){
$("#messages").prepend(name + ": " + message + "<br>");
}
now.setGroups = function(){}
$("#send-button").live('click',function(){
now.distributeMessage($("#text-input").val(),now.groupname);
$("#text-input").val("");
$("#text-input").focus();
});
});
</script>
</html>