@chat21/chat21-web-widget 5.0.52 → 5.0.53-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,147 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Tilechat Widget deprecated</title>
6
- <base href="./">
7
- <link rel="icon" type="image/x-icon" href="favicon.ico">
8
- <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
9
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
- <script>
11
- // Handler for .ready() called.
12
- window.tiledeskSettings =
13
- {
14
- projectid: "5b55e806c93dde00143163dd",
15
- development: true,
16
- calloutTimer: 10,
17
- userFullname: "Dario",
18
- userEmail: "czone555@gmail.com",
19
- welcomeTitle: "Benvenuti su questa chat",
20
- welcomeMsg: "Come possiamo aiutarti?",
21
- logoChat: "http://serataromanticaroma.it/wp-content/uploads/2018/09/Logo-bianco-04.png",
22
- startFromHome: true,
23
- preChatForm: true,
24
- autoStart: true
25
- };
26
-
27
- (function(d, s, id) {
28
- var js, fjs = d.getElementsByTagName(s)[0];
29
- if (d.getElementById(id)) return;
30
- js = d.createElement(s);
31
- js.id = id; js.async=!0;
32
- js.src = "./tiledesk.js";
33
- fjs.parentNode.insertBefore(js, fjs);
34
- }(document, 'script', 'tiledesk-jssdk'));
35
-
36
-
37
- localStorage.setItem("user_fullname", "Andrea from localStorage");
38
- localStorage.setItem("user_email", "andrea.leo@f21.it");
39
-
40
-
41
- window.tileDeskAsyncInit = function() {
42
- window.tiledesk.on('onLoadParams', function(event_data) {
43
- window.tiledeskSettings.welcomeMsg = " Hello at: " + new Date().toLocaleString();
44
- window.tiledeskSettings.userFullname = localStorage.getItem("user_fullname");
45
- window.tiledeskSettings.userEmail = localStorage.getItem("user_email");
46
- window.tiledesk.show();
47
- window.tiledesk.open();
48
- //window.tiledesk.hide();
49
- //window.tiledesk.open();
50
- });
51
-
52
- window.tiledesk.on('onBeforeMessageSend', function(event_data) {
53
- var message = event_data.detail;
54
- message.attributes.pagetitle = document.title;
55
- message.attributes.userCompany = "Frontiere21";
56
- });
57
-
58
- window.tiledesk.on('onAfterMessageSend', function(event_data) {
59
- // console.log("onAfterMessageSend called ", event_data);
60
- });
61
-
62
- window.tiledesk.on('isLoggedIn', function(event_data) {
63
- // console.log("isLoggedIn called ", event_data);
64
- });
65
-
66
- }
67
- </script>
68
- </head>
69
-
70
- <style>
71
- body {
72
- background-color: antiquewhite;
73
- }
74
- a {
75
- color:black;
76
- background-color: brown;
77
- text-decoration: chartreuse;
78
- text-decoration-line: overline;
79
- }
80
- </style>
81
-
82
- <body>
83
- <a href="">test</a>
84
- <button id="idShow">
85
- SHOW
86
- </button>
87
- <button id="idHide">
88
- HIDE
89
- </button>
90
- <button id="idOpen">
91
- OPEN
92
- </button>
93
- <button id="idClose">
94
- CLOSE
95
- </button>
96
- <button id="idAuth">
97
- AUTH
98
- </button>
99
-
100
- <button id="preChatForm">
101
- preChatForm
102
- </button>
103
-
104
-
105
- <script type="application/javascript">
106
- $( document ).ready(function() {
107
-
108
- var isOpenPrechatForm = true;
109
-
110
- $( "#idShow" ).click(function() {
111
- alert( "Handler for .click() idShow." );
112
- window.tiledesk.show();
113
- });
114
- $( "#idHide" ).click(function() {
115
- alert( "Handler for .click() idHide." );
116
- window.tiledesk.hide();
117
- });
118
- $( "#idOpen" ).click(function() {
119
- alert( "Handler for .click() idOpen." );
120
- window.tiledesk.open();
121
- });
122
- $( "#idClose" ).click(function() {
123
- alert( "Handler for .click() idClose." );
124
- window.tiledesk.close();
125
- });
126
- $( "#idAuth" ).click(function() {
127
- alert( "Handler for .click() idAuth." );
128
- window.tiledesk.signInWithCustomToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQW5kcmVhIiwiZW1haWwiOiJhbmRyZWEubGVvQGZyb250aWVyZTIxLml0IiwiaWF0IjoxNTQwNDYwOTM2MzkzLCJleHRlcm5hbF9pZCI6IjEyMzQ1NiJ9.wD9YDI3hEXBipoQ7kUIPRqNybFNuXZb9OPEqkxLtJoY");
129
- //window.tiledesk.signInAnonymous();
130
- });
131
-
132
- $( "#preChatForm" ).click(function() {
133
- isOpenPrechatForm = !isOpenPrechatForm;
134
- alert( "Handler for .click() isOpenPrechatForm. "+isOpenPrechatForm );
135
- window.tiledesk.setPreChatForm(isOpenPrechatForm);
136
- });
137
-
138
-
139
- });
140
-
141
-
142
-
143
- </script>
144
-
145
-
146
- </body>
147
- </html>
@@ -1,95 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Tilechat Widget</title>
6
- <base href="./">
7
- <link rel="icon" type="image/x-icon" href="favicon.ico">
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
- </head>
10
- <body>
11
- <script type="application/javascript">
12
- window.tiledeskSettings =
13
- {
14
- projectid: "5b55e806c93dde00143163dd",
15
- development: true,
16
- calloutTimer: 10,
17
- autoStart:false,
18
- startFromHome: true
19
- };
20
-
21
- (function(d, s, id) {
22
- var js, fjs = d.getElementsByTagName(s)[0];
23
- if (d.getElementById(id)) return;
24
- js = d.createElement(s); js.id = id; //js.async=!0;
25
- js.src = "./tiledesk.js";
26
- fjs.parentNode.insertBefore(js, fjs);
27
- }(document, 'script', 'tiledesk-jssdk'));
28
- </script>
29
-
30
-
31
-
32
- <script type="application/javascript">
33
-
34
- function createCORSRequest(method, url, async) {
35
-
36
- var xhr = new XMLHttpRequest();
37
- if ("withCredentials" in xhr) {
38
-
39
- // Check if the XMLHttpRequest object has a "withCredentials" property.
40
- // "withCredentials" only exists on XMLHTTPRequest2 objects.
41
- xhr.open(method, url, async);
42
- // console.log("xhr12");
43
- } else if (typeof XDomainRequest != "undefined") {
44
-
45
- // Otherwise, check if XDomainRequest.
46
- // XDomainRequest only exists in IE, and is IE's way of making CORS requests.
47
- xhr = new XDomainRequest();
48
- xhr.open(method, url);
49
- // console.log("xhr111");
50
-
51
- } else {
52
-
53
- // Otherwise, CORS is not supported by the browser.
54
- xhr = null;
55
- // console.log("xhrnull");
56
-
57
- }
58
- return xhr;
59
- }
60
-
61
-
62
- window.tileDeskAsyncInit = function() {
63
- window.tiledesk.on('onLoadParams', function(event_data) {
64
- // console.log("window.tiledesk", window.tiledesk);
65
- var httpRequest = createCORSRequest('POST', 'https://demo@f21.it:password@api.tiledesk.com/v1/5b55e806c93dde00143163dd/jwt/generatetestjwt',false); //set async to false because loadParams must return when the get is complete
66
- if (!httpRequest) {
67
- throw new Error('CORS not supported');
68
- }
69
-
70
- // console.log("onreadystatechange1");
71
- httpRequest.onload = function() {
72
- if (httpRequest.readyState === XMLHttpRequest.DONE) {
73
- if (httpRequest.status === 200) {
74
- // alert(httpRequest.responseText);
75
- // console.log("httpRequest.responseText", httpRequest.responseText);
76
- window.tiledesk.signInWithCustomToken(httpRequest.responseText);
77
- return true;
78
- } else {
79
- alert('There was a problem with the request.');
80
- }
81
- }
82
- };
83
-
84
- httpRequest.onerror = function() {
85
- console.error('There was an error!');
86
- };
87
-
88
- httpRequest.send();
89
- return false;
90
- });
91
- }
92
- </script>
93
-
94
- </body>
95
- </html>
@@ -1,49 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Tilechat Widget</title>
6
- <base href="./">
7
- <link rel="icon" type="image/x-icon" href="favicon.ico">
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
- </head>
10
- <body>
11
- <script type="application/javascript">
12
- window.tiledeskSettings =
13
- {
14
- projectid: "5b55e806c93dde00143163dd",
15
- development: true,
16
- calloutTimer: 10,
17
- autoStart:false,
18
- startFromHome: true,
19
- isLogEnabled: true
20
- };
21
-
22
- (function(d, s, id) {
23
- var js, fjs = d.getElementsByTagName(s)[0];
24
- if (d.getElementById(id)) return;
25
- js = d.createElement(s); js.id = id; //js.async=!0;
26
- js.src = "./tiledesk.js";
27
- fjs.parentNode.insertBefore(js, fjs);
28
- }(document, 'script', 'tiledesk-jssdk'));
29
- </script>
30
-
31
-
32
-
33
- <script type="application/javascript">
34
-
35
-
36
-
37
-
38
- window.tileDeskAsyncInit = function() {
39
- window.tiledesk.on('onLoadParams', function(event_data) {
40
- // console.log("onLoadParams", event_data);
41
- // console.log("window.tiledesk", window.tiledesk);
42
-
43
- window.tiledesk.signInWithCustomToken("JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub21lIjoiQW5kcmVhIiwiY29nbm9tZSI6ImxlbyIsImlhdCI6MTU0MzQyNDU3MCwiZXhwIjoxNTQzNDI0NTczfQ.x1QtbKuVprZjgPv9DaeGa7cnzqtZRivgf5Dhv36qNG8");
44
- });
45
- }
46
- </script>
47
-
48
- </body>
49
- </html>
@@ -1,147 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Tilechat Widget deprecated</title>
6
- <base href="./">
7
- <link rel="icon" type="image/x-icon" href="favicon.ico">
8
- <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
9
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
- <script>
11
- // Handler for .ready() called.
12
- window.tiledeskSettings =
13
- {
14
- projectid: "5b55e806c93dde00143163dd",
15
- development: true,
16
- calloutTimer: 10,
17
- userFullname: "Dario",
18
- userEmail: "czone555@gmail.com",
19
- welcomeTitle: "Benvenuti su questa chat",
20
- welcomeMsg: "Come possiamo aiutarti?",
21
- logoChat: "http://serataromanticaroma.it/wp-content/uploads/2018/09/Logo-bianco-04.png",
22
- startFromHome: true,
23
- preChatForm: true,
24
- autoStart: true
25
- };
26
-
27
- (function(d, s, id) {
28
- var js, fjs = d.getElementsByTagName(s)[0];
29
- if (d.getElementById(id)) return;
30
- js = d.createElement(s);
31
- js.id = id; js.async=!0;
32
- js.src = "./tiledesk.js";
33
- fjs.parentNode.insertBefore(js, fjs);
34
- }(document, 'script', 'tiledesk-jssdk'));
35
-
36
-
37
- localStorage.setItem("user_fullname", "Andrea from localStorage");
38
- localStorage.setItem("user_email", "andrea.leo@f21.it");
39
-
40
-
41
- window.tileDeskAsyncInit = function() {
42
- window.tiledesk.on('onLoadParams', function(event_data) {
43
- window.tiledeskSettings.welcomeMsg = " Hello at: " + new Date().toLocaleString();
44
- window.tiledeskSettings.userFullname = localStorage.getItem("user_fullname");
45
- window.tiledeskSettings.userEmail = localStorage.getItem("user_email");
46
- window.tiledesk.show();
47
- window.tiledesk.open();
48
- //window.tiledesk.hide();
49
- //window.tiledesk.open();
50
- });
51
-
52
- window.tiledesk.on('onBeforeMessageSend', function(event_data) {
53
- var message = event_data.detail;
54
- message.attributes.pagetitle = document.title;
55
- message.attributes.userCompany = "Frontiere21";
56
- });
57
-
58
- window.tiledesk.on('onAfterMessageSend', function(event_data) {
59
- // console.log("onAfterMessageSend called ", event_data);
60
- });
61
-
62
- window.tiledesk.on('isLoggedIn', function(event_data) {
63
- // console.log("isLoggedIn called ", event_data);
64
- });
65
-
66
- }
67
- </script>
68
- </head>
69
-
70
- <style>
71
- body {
72
- background-color: antiquewhite;
73
- }
74
- a {
75
- color:black;
76
- background-color: brown;
77
- text-decoration: chartreuse;
78
- text-decoration-line: overline;
79
- }
80
- </style>
81
-
82
- <body>
83
- <a href="">test</a>
84
- <button id="idShow">
85
- SHOW
86
- </button>
87
- <button id="idHide">
88
- HIDE
89
- </button>
90
- <button id="idOpen">
91
- OPEN
92
- </button>
93
- <button id="idClose">
94
- CLOSE
95
- </button>
96
- <button id="idAuth">
97
- AUTH
98
- </button>
99
-
100
- <button id="preChatForm">
101
- preChatForm
102
- </button>
103
-
104
-
105
- <script type="application/javascript">
106
- $( document ).ready(function() {
107
-
108
- var isOpenPrechatForm = true;
109
-
110
- $( "#idShow" ).click(function() {
111
- alert( "Handler for .click() idShow." );
112
- window.tiledesk.show();
113
- });
114
- $( "#idHide" ).click(function() {
115
- alert( "Handler for .click() idHide." );
116
- window.tiledesk.hide();
117
- });
118
- $( "#idOpen" ).click(function() {
119
- alert( "Handler for .click() idOpen." );
120
- window.tiledesk.open();
121
- });
122
- $( "#idClose" ).click(function() {
123
- alert( "Handler for .click() idClose." );
124
- window.tiledesk.close();
125
- });
126
- $( "#idAuth" ).click(function() {
127
- alert( "Handler for .click() idAuth." );
128
- window.tiledesk.signInWithCustomToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQW5kcmVhIiwiZW1haWwiOiJhbmRyZWEubGVvQGZyb250aWVyZTIxLml0IiwiaWF0IjoxNTQwNDYwOTM2MzkzLCJleHRlcm5hbF9pZCI6IjEyMzQ1NiJ9.wD9YDI3hEXBipoQ7kUIPRqNybFNuXZb9OPEqkxLtJoY");
129
- //window.tiledesk.signInAnonymous();
130
- });
131
-
132
- $( "#preChatForm" ).click(function() {
133
- isOpenPrechatForm = !isOpenPrechatForm;
134
- alert( "Handler for .click() isOpenPrechatForm. "+isOpenPrechatForm );
135
- window.tiledesk.setPreChatForm(isOpenPrechatForm);
136
- });
137
-
138
-
139
- });
140
-
141
-
142
-
143
- </script>
144
-
145
-
146
- </body>
147
- </html>