-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
71 lines (68 loc) · 2.07 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
<html>
<head>
<title>Jody</title>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: white;
}
#webchat {
width: inherit;
height: inherit;
margin: 0;
padding: 0;
background-color: white;
}
</style>
</head>
<body>
<script>!(function () {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const userid = urlParams.get('userid');
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src =
"https://cdn.jsdelivr.net/npm/rasa-webchat@1.0.1/lib/index.js"),
// Replace 1.x.x with the version that you want
(e.async = !0),
(e.onload = () => {
window.WebChat.default(
{
initPayload: "/greet",
customData: {"language":"en", "userid": userid},
socketUrl: "http://localhost:5005",
hideWhenNotConnected: false,
title: "Jody",
subtitle: "",
embedded: true,
fullScreenMode: true,
params: {
storage: "session"
}
},
null
);
}),
t.insertBefore(e, t.firstChild);
})();
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
var hideSender = function() {
if( $('.rw-replies').length || $('#wave').length || $('.rw-message').length == 0){
$("textarea").prop('disabled', true);
$("textarea").prop('placeholder', "Use one of the buttons to answer.");
}
else {
$("textarea").prop('disabled', false);
$("textarea").prop('placeholder', "Type a message...");
}
}
setInterval(hideSender, 250);
</script>
</body>
</html>