-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (43 loc) · 2.08 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="with=device-width, initial-scale=1.0">
<title>Amazon Lex for JavaScript - Sample Application (Book Appointment)</title>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.41.0.min.js"></script>
<script src="js/jquery-3.3.1.js"></script>
<script src="js/bootstrap.js" ></script>
<script src="js/bootstrap.bundle.js" ></script>
<script src="js/myLexLibrary.js" ></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-reboot.min.css" />
<link rel="stylesheet" type="text/css" href="css/csc-lex-bot.css" />
</head>
<body>
<h1 style="text-align: center">Amazon Lex - Book Appointment</h1>
<p style="width: 100%; text-align: center">
This little chatbot shows how easy it is to incorporate
<a href="https://aws.amazon.com/lex/" title="Amazon Lex (product)" target="_new">Amazon Lex</a> into your web pages. Try it out.
</p>
<div class="container">
<div id="conversation" class="container" style="width: 100%; height: 400px; border: 1px solid #ccc; background-color: #eee; padding: 4px; overflow: scroll"></div>
<form id="chatform" class="container" style="margin-top: 10px; margin-left: -12px" onsubmit="return pushChat();">
<label><input type="text" class="form-control" id="wisdom" size="80" value="" placeholder="Book an appointment"></label>
</form>
</div>
<script type="text/javascript">
// set the focus to the input box
document.getElementById("wisdom").focus();
// Initialize the Amazon Cognito credentials provider
AWS.config.region = '<yourCognitoRegion>'; // Region
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
// Provide your Pool Id here
IdentityPoolId: '<cognitoPoolId>'
});
var lexruntime = new AWS.LexRuntime();
var lexUserId = '<yourUser>'; // + Date.now();
var sessionAttributes = {};
</script>
</body>
</html>