-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwhatsapp.js
32 lines (29 loc) · 928 Bytes
/
whatsapp.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
$(document).ready(function () {
$(".show-chat").click(function () {
if ($('#whatsapp-chat:visible').length)
$("#whatsapp-chat").addClass("hide").removeClass("show");
else
$("#whatsapp-chat").addClass("show").removeClass("hide");
});
$(".close-chat").click(function () {
$("#whatsapp-chat").addClass("hide").removeClass("show");
});
$("#send").click(function () {
var a = document.getElementById("chat-input");
if ("" != a.value) {
var b = $("#get-number").text(),
c = document.getElementById("chat-input").value,
d = "https://web.whatsapp.com/send",
e = b,
f = "&text=" + c;
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent
)
)
var d = "whatsapp://send";
var g = d + "?phone=+14155238886" + e + f;
window.open(g, "_blank");
}
});
});