This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
embedded.html
51 lines (43 loc) · 1.72 KB
/
embedded.html
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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cluster1.telifoun.com/webapi/en/mqttchat.js?appid=mqttchat-87226030&uf=0"></script>
</head>
<body>
<div id="mqttchat"
data-layout="embedded"
class="mqttchat-lite"
data-user-name="user"
data-user-surname="1"
data-user-link=""
data-user-avatar=""
data-user-id="21"
data-user-gender="0"
data-width="800"
data-height="540"
></div>
<script type="text/javascript">
/** On error event **/
telifounJQ(document).on("mqttchat-error",function(e){
console.log(JSON.stringify(e.mqttchat_data));
});
/** on page load complete **/
telifounJQ(document).ready(function() {
/** start chat with user id **/
telifounJQ(document).on("mqttchat-load-complete",function(e){
console.log("load complete");
telifounJQ.mqttchat_cloud.__startChatWithUser(2);
});
/** On Incoming Message Event **/
telifounJQ(document).on("mqttchat-incoming-message",function(e){
console.log(JSON.stringify(e.mqttchat_data));
});
/** On not readed messages count change event **/
telifounJQ(document).on("mqttchat-not-read-messages-count-update",function(e){
console.log(e.mqttchat_data);
});
});
</script>
</body>
</html>