-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (59 loc) · 2.29 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
<!DOCTYPE html>
<!--
This is a sample HTML file which shows how to embed a full-window instance of WebChat.
1. Build the project: "npm run build"
2. Start a web server: "npm run start"
3. Aim your browser at "http://localhost:8000/samples?[parameters as listed below]"
For ease of testing, several parameters can be set in the query string:
* s = Direct Line secret, or
* t = Direct Line token (obtained by calling Direct Line's Generate Token)
* domain = optionally, the URL of an alternate Direct Line endpoint
* webSocket = set to 'true' to use WebSocket to receive messages (currently defaults to false)
* userid, username = id (and optionally name) of bot user
* botid, botname = id (and optionally name) of bot
-->
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Bot Chat</title>
<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
}
</style>
</head>
<body>
<div id="BotChatGoesHere"></div>
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script>
const params = BotChat.queryParams(location.search);
const user = {
id: params['userid'] || 'userid',
name: params['username'] || 'username'
};
const bot = {
id: params['botid'] || 'botid',
name: params['botname'] || 'botname'
};
window['botchatDebug'] = params['debug'] && params['debug'] === 'true';
BotChat.App({
bot: bot,
locale: params['locale'] || 'en-US',
resize: 'window',
// sendTyping: true, // defaults to false. set to true to send 'typing' activities to bot (and other users) when user is typing
user: user,
directLine: {
secret: params['s'] || '',
token: params['t'] || '',
domain: params['domain'] || '/directline',
webSocket: false //params['webSocket'] && params['webSocket'] === 'true' // defaults to true
}
}, document.getElementById('BotChatGoesHere'));
</script>
</body>
</html>