Skip to content

Instantly share code, notes, and snippets.

@niuage
Created June 4, 2020 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niuage/48993fc936db47ca3dc29c16b92caf3b to your computer and use it in GitHub Desktop.
Save niuage/48993fc936db47ca3dc29c16b92caf3b to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
</html>
<body>
<div id="why" style="position: absolute; top: 10px; right: 60px; z-index: 70000">
boom
</div>
<script type="text/javascript">
(function(t,a,l,k,j,s){
s=a.createElement('script');s.async=1;s.src="https://cdn.talkjs.com/talk.js";a.head.appendChild(s)
;k=t.Promise;t.Talk={v:3,ready:{then:function(f){if(k)return new k(function(r,e){l.push([f,r,e])});l.push([f])},catch:function(){return k&&new k()},c:l}};})(window,document,[]);
Talk.ready.then(function() {
var me = new Talk.User({
id: "123456",
name: "Alice",
email: "alice@example.com",
photoUrl: "https://demo.talkjs.com/img/alice.jpg",
welcomeMessage: "Hey there! How are you? :-)"
});
var session = new Talk.Session({
appId: "t5BIXhfw",
me: me
});
var other = new Talk.User({
id: "654321",
name: "Sebastian",
email: "Sebastian@example.com",
photoUrl: "https://demo.talkjs.com/img/sebastian.jpg",
welcomeMessage: "Hey, how can I help?"
});
const conversation = session.getOrCreateConversation(Talk.oneOnOneId(me, other));
conversation.setParticipant(me);
conversation.setParticipant(other);
var popup = session.createPopup(conversation);
popup.mount({show: true});
});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment