forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<title>Web Chat: Send typing</title> | ||
<!-- | ||
For demonstration purposes, we are using the development branch of Web Chat at "/master/webchat.js". | ||
When you are using Web Chat for production, you should use the latest stable release at "/latest/webchat.js", | ||
or lock down on a specific version with the following format: "/4.1.0/webchat.js". | ||
--> | ||
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script> | ||
<style> | ||
html, body { height: 100% } | ||
body { margin: 0 } | ||
|
||
#webchat, | ||
#webchat > * { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="webchat" role="main"></div> | ||
<script> | ||
(async function () { | ||
// In this demo, we are using Direct Line token from MockBot. | ||
// To talk to your bot, you should use the token exchanged using your Direct Line secret. | ||
// You should never put the Direct Line secret in the browser or client app. | ||
// https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication | ||
|
||
const res = await fetch('https://webchat-mockbot.azurewebsites.net/directline/token', { method: 'POST' }); | ||
const { token } = await res.json(); | ||
|
||
window.WebChat.renderWebChat({ | ||
directLine: window.WebChat.createDirectLine({ token }), | ||
|
||
// Web Chat will send typing activity when "sendTyping" is set to true | ||
sendTyping: true | ||
}, document.getElementById('webchat')); | ||
|
||
document.querySelector('#webchat > *').focus(); | ||
})().catch(err => console.error(err)); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Redirect information | ||
|
||
Due to renaming our sample files, the sample links on our NPM page are temporarily pointing to the wrong URL. | ||
|
||
Please click the link below to be redirected. Sorry for the inconvenience. | ||
|
||
## [07.a.customization-timestamp-grouping](./../07.a.customization-timestamp-grouping/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Redirect information | ||
|
||
Due to renaming our sample files, the sample links on our NPM page are temporarily pointing to the wrong URL. | ||
Due to renaming our sample files, the sample links on our NPM page are temporarily pointing to the wrong URL. | ||
|
||
Please click the link below to be redirected. Sorry for the inconvenience. | ||
|
||
## [07.customization-timestamp-grouping](./../07.customization-timestamp-grouping/) | ||
## [07.a.customization-timestamp-grouping](./../07.a.customization-timestamp-grouping/) |