-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
55 lines (52 loc) · 1.66 KB
/
index.html
File metadata and controls
55 lines (52 loc) · 1.66 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script>
// helper function
function getQueryStringValue (key) {
return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}
</script>
<title>ChatCamp JavaScript SDK - Widget Example</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<!-- Include ChatCamp App div -->
<div id="cc-app"></div>
<!-- Load ChatCamp JavaScript UI Kit -->
<script src="https://cdn.chatcamp.io/js/chatcamp-ui.min.js"></script>
<script>
// Create user object from query parameters
let user = {
id: getQueryStringValue('id') || '1'
}
if(getQueryStringValue('displayName')) {
user.displayName = getQueryStringValue('displayName')
}
// Initialize ChatCamp
window.ChatCampUi.init({
appId: "6346990561630613504",
user: user,
ui: {
theme: {
primaryBackground: "#3f45ad",
primaryText: "#ffffff",
secondaryBackground: "#ffffff",
secondaryText: "#000000",
tertiaryBackground: "#f4f7f9",
tertiaryText: "#263238"
},
roster: {
tabs: ['recent', 'rooms', 'users'],
render: true,
defaultMode: 'open' // other possible values are minimize, hidden
}
}
})
</script>
</body>
</html>