-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestlive.html
More file actions
104 lines (86 loc) · 3.75 KB
/
Copy pathtestlive.html
File metadata and controls
104 lines (86 loc) · 3.75 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!doctype html>
<html class="no-js" lang="pt-br">
<head>
<meta charset="utf-8">
<title>Atendimento COVID-19 - Governo de Goiás</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
<meta http-equiv="Content-Language" content="pt-br">
<meta name="theme-color" content="#fafafa">
</head>
<body>
<!--[if IE]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
<!-- Start of Rocket.Chat Livechat Script -->
<script type="text/javascript">
(function (w, d, s, u) {
w.RocketChat = function (c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
j.async = true; j.src = 'https://livechat.goias.gov.br/livechat/rocketchat-livechat.min.js?_=201903270000';
h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'https://livechat.goias.gov.br/livechat');
RocketChat(function () {
var that = this;
var debug = false;
that.setTheme({
color: '#38a236', // widget title background color
fontColor: '#FFFFFF' // widget title font color
});
// Welcome department id
that.setDepartment('Lcakk2ppLy6vmGZCK');
that.onChatEnded(function () {
that.setDepartment('Lcakk2ppLy6vmGZCK');
});
that.setLanguage('pt-br');
// GeoLocation and IP
try {
var request = new XMLHttpRequest();
request.open('GET', 'https://www.cloudflare.com/cdn-cgi/trace', true);
request.onload = function () {
if (this.status >= 200 && this.status < 400) {
var ipRegex = /^ip\=(.*)$/gm;
var found = this.response.match(ipRegex);
var ip = '';
if (found.length > 0) {
ip = found[0].replace('ip=', '');
}
that.setCustomField('ip', ip);
if (debug) {
console.log('ip:', ip);
}
}
};
request.onabort = function () { };
request.onerror = function () { };
request.send();
} catch (error) {
if (debug) {
console.log('ip error:', error);
}
}
// Geo
if (navigator.geolocation && (location.host === 'localhost:8080' || location.protocol === 'https:')) {
try {
navigator.geolocation.getCurrentPosition(function (position) {
that.setCustomField('position_latitude', position.coords.latitude.toString());
that.setCustomField('position_longitude', position.coords.longitude.toString());
if (debug) {
console.log('latitude:', position.coords.latitude);
console.log('longitude:', position.coords.longitude);
}
});
} catch (error) {
if (debug) {
console.log('geo error:', error);
}
}
}
if (document.body.offsetWidth < 1024) {
that.minimizeWidget();
}
});
</script>
<!-- End of Rocket.Chat Livechat Script -->
</body>
</html>