-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (58 loc) · 1.99 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
68
69
70
71
72
73
74
<html>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/css/foundation.css">
<link rel="stylesheet" href="./css/style.css">
<body>
<div id="chatbot">
<div id="text-container">
<section id="conversation-text-body" tabindex="0" aria-label="Chatbot conversation" aria-live="polite">
<section class="conversation-text bot" aria-label="The bot said <time>">Hello, how are you?</section>
</section>
</div>
</div>
<div class="control-container">
<form id="chatbot-form" class="form-inline">
<label for="user-msg">Ask me a question</label>
<input type="text" autocomplete="off" id="user-msg" class="form-control">
<button id="send" type="button" class="button large">Send</button>
</form>
</div>
<button id="connect" type="button" class="button large">Start</button>
</body>
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script>
<script src="http://unpkg.com/botframework-directlinejs/directLine.js"/></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js"></script>
<script>
var directLine;
var bot = new Object();
bot.userId='user';
botname='name';
bot.email='[email protected]';
bot.organisation='organisation';
bot.site='site';
bot.id='<bot id>';
bot.secret='<bot secret>';
var UI = new Object();
UI.connect = 'connect';
UI.userinputId = 'user-msg';
UI.submitbuttonId = 'send';
UI.conversationId = 'conversation-text-body';
UI.conversationContainerId = 'conversation-text-body';
$(function(){
$(document).on("click", ".actionable", function(){
var obj = $(this);
switch(obj.attr('data-type'))
{
case "openUrl":
window.open(obj.attr('data-value'), '_blank');
break;
default:
$('#' + UI.userinputId).val(obj.attr('data-value'));
$('#' + UI.submitbuttonId).click();
break;
}
});
});
</script>
<script src="./scripts/rxjs.js"></script>
</html>