@chat21/chat21-web-widget 5.0.70 → 5.0.71-rc.10
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.
- package/.github/workflows/build.yml +2 -2
- package/CHANGELOG.md +37 -0
- package/Dockerfile +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +49 -49
- package/src/app/component/conversation-detail/conversation/conversation.component.html +3 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +3 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +3 -8
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +2 -3
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +2 -4
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +1 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +8 -4
- package/src/app/component/last-message/last-message.component.scss +1 -1
- package/src/app/component/message/carousel/carousel.component.html +6 -2
- package/src/app/component/message/carousel/carousel.component.scss +22 -0
- package/src/app/component/message/carousel/carousel.component.ts +6 -5
- package/src/app/component/message/image/image.component.ts +0 -3
- package/src/app/providers/global-settings.service.ts +5 -0
- package/src/app/sass/_variables.scss +1 -1
- package/src/app/utils/constants.ts +0 -2
- package/src/app/utils/globals.ts +4 -3
- package/src/app/utils/rules.ts +1 -1
- package/src/assets/images/icons/no-image.svg +6 -0
- package/src/assets/js/chat21client.js +7 -3
- package/src/assets/twp/chatbot-panel.html +223 -19
- package/src/assets/twp/index-dev.html +56 -17
- package/src/assets/twp/index.html +110 -37
- package/src/chat21-core/models/conversation.ts +2 -1
- package/src/chat21-core/models/upload.ts +0 -1
- package/src/chat21-core/providers/abstract/upload.service.ts +3 -0
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +2 -1
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +128 -6
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +10 -1
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +1 -1
- package/src/chat21-core/providers/native/native-upload-service.ts +68 -0
- package/src/chat21-core/utils/constants.ts +15 -1
- package/src/chat21-core/utils/triggerHandler.ts +0 -1
- package/src/chat21-core/utils/utils-message.ts +8 -0
- package/src/chat21-core/utils/utils.ts +0 -39
- package/src/launch.js +0 -1
- package/src/widget-config-template.json +2 -2
- package/src/widget-config.json +2 -1
package/src/app/utils/globals.ts
CHANGED
|
@@ -123,7 +123,6 @@ export class Globals {
|
|
|
123
123
|
LABEL_PREVIEW: string;
|
|
124
124
|
|
|
125
125
|
// ============ BEGIN: EXTERNAL PARAMETERS ==============//
|
|
126
|
-
globalsParameters: any;
|
|
127
126
|
autoStart: boolean;
|
|
128
127
|
startHidden: boolean;
|
|
129
128
|
isShown: boolean;
|
|
@@ -218,6 +217,8 @@ export class Globals {
|
|
|
218
217
|
onPageChangeVisibilityDesktop: 'open' | 'close' | 'last'; // ******* new ********
|
|
219
218
|
displayOnMobile: boolean; // ******* new ********
|
|
220
219
|
displayOnDesktop: boolean; // ******* new ********
|
|
220
|
+
|
|
221
|
+
hiddenMessage: string; // ******* new ********
|
|
221
222
|
constructor(
|
|
222
223
|
) { }
|
|
223
224
|
|
|
@@ -226,7 +227,6 @@ export class Globals {
|
|
|
226
227
|
* 1: initParameters
|
|
227
228
|
*/
|
|
228
229
|
initDefafultParameters() {
|
|
229
|
-
this.globalsParameters = {};
|
|
230
230
|
|
|
231
231
|
let wContext: any = window;
|
|
232
232
|
if (window.frameElement && window.frameElement.getAttribute('tiledesk_context') === 'parent') {
|
|
@@ -414,6 +414,8 @@ export class Globals {
|
|
|
414
414
|
this.displayOnMobile = true
|
|
415
415
|
this.onPageChangeVisibilityMobile = 'close'
|
|
416
416
|
|
|
417
|
+
/**set an hidden message to show when conversation starts */
|
|
418
|
+
this.hiddenMessage = null
|
|
417
419
|
|
|
418
420
|
// ============ END: SET EXTERNAL PARAMETERS ==============//
|
|
419
421
|
|
|
@@ -468,7 +470,6 @@ export class Globals {
|
|
|
468
470
|
|
|
469
471
|
this.newConversationStart = true;
|
|
470
472
|
|
|
471
|
-
|
|
472
473
|
}
|
|
473
474
|
|
|
474
475
|
|
package/src/app/utils/rules.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000">
|
|
2
|
+
<g>
|
|
3
|
+
<rect fill="none" height="24" width="24"/>
|
|
4
|
+
<path d="M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Chat21Client
|
|
3
3
|
|
|
4
|
-
v0.1.12.
|
|
4
|
+
v0.1.12.7
|
|
5
5
|
|
|
6
6
|
@Author Andrea Sponziello
|
|
7
7
|
@Member Gabriele Panico
|
|
@@ -546,7 +546,7 @@ class Chat21Client {
|
|
|
546
546
|
if (this.log) {
|
|
547
547
|
console.log("this.on_message_handler already subscribed. Reconnected num", this.reconnections)
|
|
548
548
|
}
|
|
549
|
-
|
|
549
|
+
subscribedCallback();
|
|
550
550
|
return
|
|
551
551
|
}
|
|
552
552
|
this.subscribeToMyConversations(() => {
|
|
@@ -1000,7 +1000,10 @@ class Chat21Client {
|
|
|
1000
1000
|
|
|
1001
1001
|
this.client.on('connect', // TODO if token is wrong it must reply with an error!
|
|
1002
1002
|
() => {
|
|
1003
|
-
if (this.log) {
|
|
1003
|
+
if (this.log) {
|
|
1004
|
+
console.log("Chat client connected. User:" + user_id)
|
|
1005
|
+
console.log("Chat client connected. this.connected:" + this.connected)
|
|
1006
|
+
}
|
|
1004
1007
|
if (!this.connected) {
|
|
1005
1008
|
if (this.log) {console.log("Chat client first connection for:" + user_id)}
|
|
1006
1009
|
this.connected = true
|
|
@@ -1027,6 +1030,7 @@ class Chat21Client {
|
|
|
1027
1030
|
);
|
|
1028
1031
|
this.client.on('close',
|
|
1029
1032
|
() => {
|
|
1033
|
+
this.connected = false
|
|
1030
1034
|
if (this.log) {console.log("Chat client close event");}
|
|
1031
1035
|
}
|
|
1032
1036
|
);
|
|
@@ -14,11 +14,26 @@
|
|
|
14
14
|
@-ms-keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* IE */
|
|
15
15
|
@keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* Opera and prob css3 final iteration */
|
|
16
16
|
|
|
17
|
+
:root {
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
body{
|
|
22
|
+
--font-family-poppins: 'Poppins', 'Roboto', Arial, sans-serif;
|
|
23
|
+
--blu: #506493;
|
|
24
|
+
--gray-light-02: rgb(223, 227, 237);
|
|
25
|
+
--base-company-logo: rgb(224,106,88);
|
|
26
|
+
--header-height: 60px;
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
#preloader {
|
|
18
31
|
background: #fff;
|
|
19
32
|
position: fixed;
|
|
20
33
|
top: 0;
|
|
21
34
|
left: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
right: 0;
|
|
22
37
|
height: 100%;
|
|
23
38
|
width: 100%;
|
|
24
39
|
z-index: 999999;
|
|
@@ -51,6 +66,52 @@
|
|
|
51
66
|
animation:blink normal 2s infinite ease-in-out; /* Opera and prob css3 final iteration */
|
|
52
67
|
}
|
|
53
68
|
|
|
69
|
+
.loader{
|
|
70
|
+
display: block;
|
|
71
|
+
z-index: 99;
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: calc( 50% - 50px);
|
|
74
|
+
left: calc( 50% - 50px);
|
|
75
|
+
width: 100px;
|
|
76
|
+
height: 100px;
|
|
77
|
+
border: 3px solid rgb(224, 106, 88);
|
|
78
|
+
border-radius: 50%;
|
|
79
|
+
|
|
80
|
+
animation: spin 7s ease-in-out;
|
|
81
|
+
animation-iteration-count: infinite;
|
|
82
|
+
transition-duration: 0.1s;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.loader:hover {
|
|
86
|
+
scale: 0.95;
|
|
87
|
+
/*Loader on hover effect*/
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.loader:active {
|
|
91
|
+
scale: 1.2;
|
|
92
|
+
/*Loader on click effect*/
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@keyframes spin {
|
|
96
|
+
0% {
|
|
97
|
+
transform: rotate(0deg);
|
|
98
|
+
border-bottom: solid 3px transparent;
|
|
99
|
+
border-top: solid 3px transparent;
|
|
100
|
+
}
|
|
101
|
+
50% {
|
|
102
|
+
transform: rotate(1800deg);
|
|
103
|
+
border: 3px solid white;
|
|
104
|
+
border-left: solid 3px transparent;
|
|
105
|
+
border-right: solid 3px transparent;
|
|
106
|
+
}
|
|
107
|
+
100% {
|
|
108
|
+
/*Reversed spinning*/
|
|
109
|
+
transform: rotate(0deg);
|
|
110
|
+
border-bottom: solid 3px transparent;
|
|
111
|
+
border-top: solid 3px transparent;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
54
115
|
#deferred-styles {
|
|
55
116
|
display: none;
|
|
56
117
|
}
|
|
@@ -162,6 +223,71 @@
|
|
|
162
223
|
z-index: 2;
|
|
163
224
|
position: absolute;
|
|
164
225
|
cursor: pointer;
|
|
226
|
+
font-size: 21px;
|
|
227
|
+
height: var(--header-height);
|
|
228
|
+
font-family: var(--font-family-poppins);
|
|
229
|
+
color: var(--blu);
|
|
230
|
+
background: white;
|
|
231
|
+
border-bottom: 1px solid var(--gray-light-02);
|
|
232
|
+
display: flex;
|
|
233
|
+
width: 100%;
|
|
234
|
+
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.header-left{
|
|
238
|
+
max-width: var(--header-height);
|
|
239
|
+
width: 100%;
|
|
240
|
+
transition: 0.3s;
|
|
241
|
+
border-right: 1px solid transparent;
|
|
242
|
+
/* border-right: 1px solid var(--gray-light-02); */
|
|
243
|
+
padding: 10px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.header-left div {
|
|
247
|
+
display: flex;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
align-items: center;
|
|
250
|
+
position: relative;
|
|
251
|
+
width: 100%;
|
|
252
|
+
height: 100%;
|
|
253
|
+
border-radius: 50%;
|
|
254
|
+
box-shadow: rgba(17, 49, 96, 0.16) 0px 8px 16px 0px, rgba(17, 49, 96, 0.06) 0px 0px 0px 1px; ;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.header-left div .logo {
|
|
258
|
+
opacity: 1;
|
|
259
|
+
width: 25px;
|
|
260
|
+
position: absolute;
|
|
261
|
+
transition: opacity 0.2s ease-in-out;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.header-right {
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
justify-content: start;
|
|
268
|
+
width: 100%;
|
|
269
|
+
padding: 0px 10px;
|
|
270
|
+
box-sizing: border-box;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.header-right .header-go-back {
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
position: relative;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.header-right .header-go-back .cds-text {
|
|
279
|
+
font-weight: 700;
|
|
280
|
+
color: var(--base-company-logo);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.header-right .header-title{
|
|
284
|
+
display: flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
justify-content: center;
|
|
287
|
+
gap: 5px;
|
|
288
|
+
font-weight: 300;
|
|
289
|
+
width: 80%;
|
|
290
|
+
|
|
165
291
|
}
|
|
166
292
|
|
|
167
293
|
.share-btn{
|
|
@@ -198,7 +324,9 @@
|
|
|
198
324
|
}
|
|
199
325
|
|
|
200
326
|
.b-agent-demo_powered_by a {
|
|
201
|
-
display: inline-
|
|
327
|
+
display: inline-flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
gap: 10px;
|
|
202
330
|
margin-top: 30px;
|
|
203
331
|
margin-bottom: 30px;
|
|
204
332
|
text-decoration: none;
|
|
@@ -212,8 +340,7 @@
|
|
|
212
340
|
}
|
|
213
341
|
.b-agent-demo_powered_by img {
|
|
214
342
|
display: inline-block;
|
|
215
|
-
height:
|
|
216
|
-
/* margin-left: 20px; */
|
|
343
|
+
height: 40px;
|
|
217
344
|
}
|
|
218
345
|
|
|
219
346
|
/* The snackbar - position it at the bottom and in the middle of the screen */
|
|
@@ -263,6 +390,12 @@
|
|
|
263
390
|
to {bottom: 0; opacity: 0;}
|
|
264
391
|
}
|
|
265
392
|
|
|
393
|
+
@media (max-width: 451px) {
|
|
394
|
+
.cds-text{
|
|
395
|
+
display: none;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
266
399
|
</style>
|
|
267
400
|
|
|
268
401
|
<!-- <script type="text/javascript">
|
|
@@ -368,8 +501,9 @@
|
|
|
368
501
|
});
|
|
369
502
|
|
|
370
503
|
window.Tiledesk('onBeforeInit', function(event_data) {
|
|
371
|
-
console.log("onBeforeInit Tiledesk FN", event_data);
|
|
372
|
-
|
|
504
|
+
// console.log("onBeforeInit Tiledesk FN", event_data);
|
|
505
|
+
var brandSrc = event_data.detail.appConfigs.brandSrc? getBrandResources(event_data.detail.appConfigs.brandSrc) : null;
|
|
506
|
+
|
|
373
507
|
setTimeout(() => {
|
|
374
508
|
document.getElementById("preloader").style.display = "none";
|
|
375
509
|
if(event_data && event_data.detail && event_data.detail.appConfigs){
|
|
@@ -377,34 +511,52 @@
|
|
|
377
511
|
}
|
|
378
512
|
}, 1000);
|
|
379
513
|
|
|
514
|
+
//open widget after 3s if is closed
|
|
380
515
|
setTimeout(() => {
|
|
381
516
|
if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
|
|
382
517
|
window.Tiledesk('open')
|
|
383
518
|
}
|
|
384
|
-
},
|
|
519
|
+
}, 1000);
|
|
385
520
|
|
|
386
521
|
});
|
|
387
522
|
|
|
388
523
|
window.Tiledesk('onInit', function(event_data) {
|
|
389
|
-
console.log("onInit Tiledesk FN", event_data);
|
|
524
|
+
// console.log("onInit Tiledesk FN", event_data);
|
|
525
|
+
window.Tiledesk('setParameter', {key: 'poweredBy', value: ''})
|
|
390
526
|
// setTimeout(() => {
|
|
391
527
|
// document.getElementById("preloader").style.display = "none";
|
|
392
528
|
// }, 1000);
|
|
393
529
|
//open widget after 3s if is closed
|
|
394
|
-
setTimeout(() => {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}, 3000);
|
|
530
|
+
// setTimeout(() => {
|
|
531
|
+
// if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
|
|
532
|
+
// window.Tiledesk('open')
|
|
533
|
+
// }
|
|
534
|
+
// }, 3000);
|
|
399
535
|
});
|
|
400
536
|
|
|
401
537
|
window.Tiledesk('onAuthStateChanged', function(event_data) {
|
|
402
|
-
console.log("AUTHENTICATED!", event_data);
|
|
538
|
+
// console.log("AUTHENTICATED!", event_data);
|
|
403
539
|
// if(event_data.detail.isLogged){
|
|
404
540
|
// console.log("isLogged!!!!", event_data);
|
|
405
541
|
// window.Tiledesk('show')
|
|
406
542
|
// }
|
|
407
543
|
});
|
|
544
|
+
|
|
545
|
+
window.Tiledesk('onMessageCreated', function(event_data) {
|
|
546
|
+
// console.log("onMessageCreated!", event_data);
|
|
547
|
+
window.parent.postMessage(event_data.detail, '*')
|
|
548
|
+
// if(event_data.detail.isLogged){
|
|
549
|
+
// console.log("isLogged!!!!", event_data);
|
|
550
|
+
// window.Tiledesk('show')
|
|
551
|
+
// }
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
window.addEventListener('message', (event_data)=> {
|
|
555
|
+
if(event_data && event_data.data && event_data.data.action === 'restart'){
|
|
556
|
+
window.Tiledesk('startConversation', event_data.data.intentName)
|
|
557
|
+
}
|
|
558
|
+
})
|
|
559
|
+
|
|
408
560
|
</script>
|
|
409
561
|
|
|
410
562
|
<script type="application/javascript">
|
|
@@ -423,6 +575,7 @@
|
|
|
423
575
|
|
|
424
576
|
var url = new URL(currentUrl);
|
|
425
577
|
var tiledesk_projectid = url.searchParams.get("tiledesk_projectid");
|
|
578
|
+
var tiledesk_widgetTitle = url.searchParams.get("tiledesk_widgetTitle");
|
|
426
579
|
var project_name = url.searchParams.get("project_name");
|
|
427
580
|
var role = url.searchParams.get("role")
|
|
428
581
|
var urlConsole = baseUrlConsole + "#/projects/"+tiledesk_projectid+"/home";
|
|
@@ -439,6 +592,36 @@
|
|
|
439
592
|
return(false);
|
|
440
593
|
}
|
|
441
594
|
|
|
595
|
+
window.onload = function() {
|
|
596
|
+
document.getElementById("tiledesk_widgetTitle").innerHTML = tiledesk_widgetTitle;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
function getBrandResources(url) {
|
|
601
|
+
var xhr = new XMLHttpRequest();
|
|
602
|
+
xhr.onreadystatechange = function () {
|
|
603
|
+
if (xhr.readyState === 4) {
|
|
604
|
+
var brandJson = JSON.parse(xhr.response)
|
|
605
|
+
if(brandJson){
|
|
606
|
+
/** TITLE AND FAVICON **/
|
|
607
|
+
brandJson['WIDGET'].META_TITLE? document.body.title = brandJson['WIDGET'].META_TITLE : null;
|
|
608
|
+
brandJson['WIDGET'].FAVICON_URL? document.querySelector("link[rel~='icon']").setAttribute('href', brandJson['WIDGET'].FAVICON_URL) : null;
|
|
609
|
+
/** FOOTER-LOGO **/
|
|
610
|
+
brandJson['COMMON'].COMPANY_LOGO? document.getElementById('footer-logo').src = brandJson['COMMON'].COMPANY_LOGO : null;
|
|
611
|
+
brandJson['COMMON'].COMPANY_SITE_NAME? document.getElementById('footer-logo').alt = brandJson['COMMON'].COMPANY_SITE_NAME : null;
|
|
612
|
+
brandJson['COMMON'].COMPANY_SITE_URL? document.getElementById('footer-link').href = brandJson['COMMON'].COMPANY_SITE_URL : null;
|
|
613
|
+
/** HEADER-LOGO **/
|
|
614
|
+
brandJson['COMMON'].BASE_LOGO_NO_TEXT? document.getElementById('header-logo').src = brandJson['COMMON'].BASE_LOGO_NO_TEXT: null;
|
|
615
|
+
brandJson['COMMON'].BRAND_PRIMARY_COLOR? document.body.style.setProperty('--base-company-logo', brandJson['COMMON'].BRAND_PRIMARY_COLOR): null;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
}
|
|
620
|
+
xhr.open('GET', url, true);
|
|
621
|
+
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
|
|
622
|
+
xhr.send();
|
|
623
|
+
}
|
|
624
|
+
|
|
442
625
|
|
|
443
626
|
|
|
444
627
|
</script>
|
|
@@ -447,27 +630,48 @@
|
|
|
447
630
|
|
|
448
631
|
<body class="website white" >
|
|
449
632
|
|
|
633
|
+
<!-- <div id="preloader">
|
|
634
|
+
<div class="logo"></div>
|
|
635
|
+
</div> -->
|
|
450
636
|
|
|
451
637
|
<div id="preloader">
|
|
452
|
-
<div class="
|
|
638
|
+
<div class="loader"></div>
|
|
453
639
|
</div>
|
|
454
640
|
|
|
455
641
|
<header id="header">
|
|
456
|
-
<ul class="nav navbar-nav navbar-left">
|
|
642
|
+
<!-- <ul class="nav navbar-nav navbar-left">
|
|
457
643
|
<li class="sign-up"><button class="share-btn" onclick="copyLink()">SHARE THIS PROTOTYPE</button></li>
|
|
458
|
-
</ul>
|
|
644
|
+
</ul> -->
|
|
645
|
+
<div class="header-left">
|
|
646
|
+
<div>
|
|
647
|
+
<img id="header-logo" class="logo" src="./tiledesk_widget_files/logo-short.png">
|
|
648
|
+
</div>
|
|
649
|
+
</div>
|
|
650
|
+
<div class="header-right">
|
|
651
|
+
<div class="header-go-back">
|
|
652
|
+
<!-- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#006cff">
|
|
653
|
+
<path d="M0 0h24v24H0z" fill="none"/><path d="M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"/>
|
|
654
|
+
</svg> -->
|
|
655
|
+
<span class="cds-text">
|
|
656
|
+
Design Studio
|
|
657
|
+
</span>
|
|
658
|
+
|
|
659
|
+
</div>
|
|
660
|
+
<div class="header-title ellips" id="tiledesk_widgetTitle"></div>
|
|
661
|
+
</div>
|
|
662
|
+
|
|
459
663
|
</header>
|
|
460
664
|
<!-- The actual snackbar -->
|
|
461
665
|
<div id="snackbar">Copied to clipboard...</div>
|
|
462
666
|
|
|
463
|
-
<div id="wrapper" class="mockup">
|
|
667
|
+
<!-- <div id="wrapper" class="mockup"> -->
|
|
464
668
|
</div>
|
|
465
669
|
|
|
466
670
|
<footer id="footer">
|
|
467
671
|
<div class="b-agent-demo_powered_by">
|
|
468
|
-
<a href="https://console.tiledesk.com/" target="_blank" style="cursor: pointer;text-decoration: none;">
|
|
672
|
+
<a href="https://console.tiledesk.com/" target="_blank" style="cursor: pointer;text-decoration: none;" id="footer-link">
|
|
469
673
|
<span style="position: relative; top: 2px;">Powered by</span>
|
|
470
|
-
<img src="./tiledesk_widget_files/logo@2x-black.png">
|
|
674
|
+
<img src="./tiledesk_widget_files/logo@2x-black.png" id="footer-logo">
|
|
471
675
|
</a>
|
|
472
676
|
</div>
|
|
473
677
|
</footer>
|
|
@@ -86,6 +86,16 @@
|
|
|
86
86
|
height: 100%;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
.container{
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
width: 100% !important;
|
|
93
|
+
justify-content: space-around;
|
|
94
|
+
}
|
|
95
|
+
#header-logo{
|
|
96
|
+
height: 50px;
|
|
97
|
+
}
|
|
98
|
+
|
|
89
99
|
#wrapper {
|
|
90
100
|
/* display: block!important; */
|
|
91
101
|
min-height: 100%;
|
|
@@ -112,6 +122,8 @@
|
|
|
112
122
|
left: 0px;
|
|
113
123
|
right: 0px;
|
|
114
124
|
width: 100%;
|
|
125
|
+
justify-content: flex-start;
|
|
126
|
+
flex-direction: row;
|
|
115
127
|
}
|
|
116
128
|
|
|
117
129
|
.row {
|
|
@@ -180,7 +192,9 @@
|
|
|
180
192
|
}
|
|
181
193
|
|
|
182
194
|
.b-agent-demo_powered_by a {
|
|
183
|
-
display: inline-
|
|
195
|
+
display: inline-flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
gap: 10px;
|
|
184
198
|
margin-top: 30px;
|
|
185
199
|
margin-bottom: 30px;
|
|
186
200
|
text-decoration: none;
|
|
@@ -436,6 +450,8 @@
|
|
|
436
450
|
window.Tiledesk('onBeforeInit', function(event_data) {
|
|
437
451
|
console.log("onBeforeInit Tiledesk FN", event_data);
|
|
438
452
|
|
|
453
|
+
var brandSrc = event_data.detail.appConfigs.brandSrc? getBrandResources(event_data.detail.appConfigs.brandSrc) : null;
|
|
454
|
+
|
|
439
455
|
setTimeout(() => {
|
|
440
456
|
if(event_data && event_data.detail && event_data.detail.appConfigs){
|
|
441
457
|
|
|
@@ -610,7 +626,7 @@
|
|
|
610
626
|
TelegramShareUrl,
|
|
611
627
|
'_blank'
|
|
612
628
|
);
|
|
613
|
-
|
|
629
|
+
}
|
|
614
630
|
|
|
615
631
|
function shareOnWhatsapp() {
|
|
616
632
|
var WhatsappShareUrl = "whatsapp://send?text=" + currentUrl;
|
|
@@ -633,6 +649,32 @@
|
|
|
633
649
|
);
|
|
634
650
|
}
|
|
635
651
|
|
|
652
|
+
function getBrandResources(url) {
|
|
653
|
+
var xhr = new XMLHttpRequest();
|
|
654
|
+
xhr.onreadystatechange = function () {
|
|
655
|
+
if (xhr.readyState === 4) {
|
|
656
|
+
var brandJson = JSON.parse(xhr.response)
|
|
657
|
+
if(brandJson){
|
|
658
|
+
/** TITLE AND FAVICON **/
|
|
659
|
+
brandJson['WIDGET'].META_TITLE? document.body.title = brandJson['WIDGET'].META_TITLE : null;
|
|
660
|
+
brandJson['WIDGET'].FAVICON_URL? document.querySelector("link[rel~='icon']").setAttribute('href', brandJson['WIDGET'].FAVICON_URL) : null;
|
|
661
|
+
/** FOOTER-LOGO **/
|
|
662
|
+
brandJson['COMMON'].COMPANY_LOGO? document.getElementById('footer-logo').src = brandJson['COMMON'].COMPANY_LOGO : null;
|
|
663
|
+
brandJson['COMMON'].COMPANY_SITE_NAME? document.getElementById('footer-logo').alt = brandJson['COMMON'].COMPANY_SITE_NAME : null;
|
|
664
|
+
brandJson['COMMON'].COMPANY_SITE_URL? document.getElementById('footer-link').href = brandJson['COMMON'].COMPANY_SITE_URL : null;
|
|
665
|
+
/** HEADER-LOGO **/
|
|
666
|
+
brandJson['COMMON'].BASE_LOGO_WHITE? document.getElementById('header-logo').src = brandJson['COMMON'].BASE_LOGO_WHITE : null;
|
|
667
|
+
/** HEADER-DOCS RESOURCES **/
|
|
668
|
+
document.getElementsByClassName('docs')[0].style.display = 'none'
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
xhr.open('GET', url, true);
|
|
673
|
+
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
|
|
674
|
+
xhr.send();
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
|
|
636
678
|
function onClickTestButton(event){
|
|
637
679
|
console.log('onClickTestButton: event-->',event)
|
|
638
680
|
if(event ==='hide'){
|
|
@@ -640,6 +682,7 @@
|
|
|
640
682
|
}else{
|
|
641
683
|
window.Tiledesk(event);
|
|
642
684
|
}
|
|
685
|
+
window.Tiledesk('setParameter', {key: 'poweredBy', value: ''})
|
|
643
686
|
}
|
|
644
687
|
|
|
645
688
|
function onClickSignInAnonymous(){
|
|
@@ -1565,7 +1608,7 @@
|
|
|
1565
1608
|
<span class="icon-bar"></span>
|
|
1566
1609
|
<span class="icon-bar"></span>
|
|
1567
1610
|
</button>
|
|
1568
|
-
<
|
|
1611
|
+
<img src="tiledesk_widget_files/logo.png" id="header-logo">
|
|
1569
1612
|
</div>
|
|
1570
1613
|
|
|
1571
1614
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
|
@@ -1585,7 +1628,7 @@
|
|
|
1585
1628
|
|
|
1586
1629
|
<div id="main" class="container">
|
|
1587
1630
|
<div class="row">
|
|
1588
|
-
<div class="col-md-
|
|
1631
|
+
<div class="col-md-12">
|
|
1589
1632
|
<h1 style="min-height: 39px;">TEST ACTIONS</h1>
|
|
1590
1633
|
<h3 id="project_name" style="min-height: 39px;"></h3>
|
|
1591
1634
|
<div class="row method_container">
|
|
@@ -2374,20 +2417,16 @@
|
|
|
2374
2417
|
</div>
|
|
2375
2418
|
</div>
|
|
2376
2419
|
|
|
2377
|
-
<div class="col-md-6"></div>
|
|
2378
2420
|
</div>
|
|
2379
2421
|
|
|
2380
|
-
<div class="row">
|
|
2381
|
-
<
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
<
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
<a href="" data-toggle="modal" data-target="#shareModal"><i class="fa-reply fa"></i>Share</a>
|
|
2388
|
-
</div>
|
|
2422
|
+
<div class="row" style="width: 100%;">
|
|
2423
|
+
<h1 id="project_name" style="min-height: 39px;"></h1>
|
|
2424
|
+
<h2></h2>
|
|
2425
|
+
<div class="b_integrations_agent_links">
|
|
2426
|
+
<a href="" data-toggle="modal" data-target="#embedModal" id="enbed" style="display: none;"><i class="fa-code fa"></i>Embed</a>
|
|
2427
|
+
<!-- <a href="mailto:?subject=Tiledesk%20widget%20test%20page"><i class="fa-envelope-o fa" target="_blank"></i>Email</a> -->
|
|
2428
|
+
<a href="" data-toggle="modal" data-target="#shareModal"><i class="fa-reply fa"></i>Share</a>
|
|
2389
2429
|
</div>
|
|
2390
|
-
<div class="col-md-6"></div>
|
|
2391
2430
|
</div>
|
|
2392
2431
|
|
|
2393
2432
|
|
|
@@ -2468,9 +2507,9 @@
|
|
|
2468
2507
|
|
|
2469
2508
|
<footer id="footer">
|
|
2470
2509
|
<div class="b-agent-demo_powered_by">
|
|
2471
|
-
<a href="https://console.tiledesk.com/" target="_blank" style="cursor: pointer;text-decoration: none;">
|
|
2510
|
+
<a href="https://console.tiledesk.com/" target="_blank" style="cursor: pointer;text-decoration: none;" id="footer-link">
|
|
2472
2511
|
<span style="position: relative; top: 2px;">Powered by</span>
|
|
2473
|
-
<img src="./tiledesk_widget_files/logo@2x-black.png">
|
|
2512
|
+
<img src="./tiledesk_widget_files/logo@2x-black.png" id="footer-logo">
|
|
2474
2513
|
</a>
|
|
2475
2514
|
</div>
|
|
2476
2515
|
</footer>
|