-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (27 loc) · 801 Bytes
/
script.js
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
var chatBtns = document.querySelectorAll(".chatbtn a")
console.log(chatBtns)
var searchText = "iniciar atendimento"
var fixChatBtn = []
for (var i = 0; i < chatBtns.length; i++) {
if (chatBtns[i].lastElementChild.textContent.toLowerCase() === searchText) {
fixChatBtn[i] = chatBtns[i]
}
}
console.log(fixChatBtn)
for (var i = 0; i < fixChatBtn.length; i++) {
fixChatBtn[i].addEventListener("click", function (e) {
e.preventDefault()
WBOTopenChat()
e.stopPropagation()
})
}
setTimeout(() => {
var headerHello = document.querySelector(
"#wbot-header .wbot-info .wbot-client"
)
headerHello.innerHTML = "Olá! Eu sou a Flora!"
}, 1000)
setTimeout(() => {
var chatBotBtn = document.getElementById("wbot-open-chat")
chatBotBtn.classList.add("start-msg")
}, 3000)