-
Notifications
You must be signed in to change notification settings - Fork 0
/
webWidget.js
40 lines (39 loc) · 1.07 KB
/
webWidget.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
34
35
36
37
38
39
40
(() => {
const script = document.currentScript;
const projectId = script.getAttribute("data-project-id");
function initElitecx() {
console.log("initElitecx");
window.tiledeskSettings = {
projectid: projectId,
};
(function (d, s, id) {
var w = window;
var d = document;
var i = function () {
i.c(arguments);
};
i.q = [];
i.c = function (args) {
i.q.push(args);
};
w.Tiledesk = i;
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.async = true;
js.src = "http://elitecx-dev-100215814.us-east-1.elb.amazonaws.com/widget/launch.js";
fjs.parentNode.insertBefore(js, fjs);
})(document, "script", "tiledesk-jssdk");
}
if (document.readyState === "complete") {
initElitecx();
} else {
document.addEventListener("readystatechange", () => {
if (document.readyState === "complete") {
initElitecx();
}
});
}
})();