-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathindex.js
83 lines (70 loc) · 2.02 KB
/
index.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
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
Talk.ready.then(() => {
const me = new Talk.User({
id: "0001",
name: "Mikaela Ross",
email: "[email protected]",
photoUrl: "https://talkjs.com/images/avatar-7.jpg",
role: "default"
});
const other1 = new Talk.User({
id: "0002",
name: "Thomas River",
email: "[email protected]",
photoUrl: "https://talkjs.com/images/avatar-5.jpg",
role: "default"
});
const other2 = new Talk.User({
id: "0003",
name: "Kirsten Doe",
email: "[email protected]",
photoUrl: "https://talkjs.com/images/avatar-1.jpg",
role: "default"
});
const other3 = new Talk.User({
id: "0004",
name: "James Fayland",
email: "[email protected]",
photoUrl: "https://talkjs.com/images/avatar-4.jpg",
role: "default"
});
window.talkSession = new Talk.Session({
appId: "<YOUR_APP_ID>",
me: me,
});
let conversation1 = talkSession.getOrCreateConversation("customStyleChat1");
let conversation2 = talkSession.getOrCreateConversation("customStyleChat2");
let conversation3 = talkSession.getOrCreateConversation("customStyleChat3");
conversation1.setParticipant(me);
conversation1.setParticipant(other1);
conversation2.setParticipant(me);
conversation2.setParticipant(other2);
conversation3.setParticipant(me);
conversation3.setParticipant(other3);
const chatbox1 = talkSession.createChatbox({
theme: {
custom: {
accentColor: '#EE4B2B',
},
},
});
const chatbox2 = talkSession.createChatbox({
theme: {
custom: {
accentColor: '#E69597',
},
},
});
const chatbox3 = talkSession.createChatbox({
theme: {
custom: {
accentColor: '#56AE57',
},
},
});
chatbox1.select(conversation1);
chatbox2.select(conversation2);
chatbox3.select(conversation3);
chatbox1.mount(document.getElementById("talkjs-container-1"));
chatbox2.mount(document.getElementById("talkjs-container-2"));
chatbox3.mount(document.getElementById("talkjs-container-3"));
});