-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (45 loc) · 1.53 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
<html>
<body>
<script>
!(function () {
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src =
"https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js"),
(e.async = !0),
(e.onload = () => {
window.WebChat.default(
{
initPayLoad: '/greet',
customData: { language: "tr" },
socketUrl: "http://localhost:5005",
title: "Anadolu Sigorta",
subtitle: "Merhaba! Size nasıl yardımcı olabilirim?",
},
null
);
}),
t.insertBefore(e, t.firstChild);
document.addEventListener("keydown", function (event) {
if (event.key === "Enter") {
window.WebChat.default(
{},
store => {
const textInput = document.querySelector(
".main .footer .input"
);
if (textInput.value) {
store.dispatch({
type: "WEB_CHAT/SEND_MESSAGE",
payload: { text: textInput.value }
});
textInput.value = "";
}
}
);
}
});
})();
</script>
</body>
</html>