forked from MrSwitch/hello.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
joinme.html
47 lines (37 loc) · 1.18 KB
/
joinme.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
<!DOCTYPE html>
<link rel="stylesheet" href="/adorn/adorn.css"/>
<script src="/adorn/adorn.js" async></script>
<script src="client_ids.js"></script>
<script src="../src/hello.polyfill.js"></script>
<script src="../src/hello.js"></script>
<script src="../src/modules/joinme.js"></script>
<title>hello( joinme )</title>
<h1>hello( joinme )</h1>
<button id='joinme' onclick="login('joinme');">join.me</button>
<div id="result"></div>
<script class="pre">
function login(network){
var joinme = hello(network);
joinme.login().then(function(){
// get user profile data
joinme.api('me').then(function(p) {
document.getElementById( network ).innerHTML = "Connected to "+ network +" as " + p.name;
});
// Get your upcoming meetings from joinme
joinme.api('/meetings').then(function(r) {
if (r.meetings && r.meetings.length > 0)
document.getElementById('result').innerHTML = JSON.stringify(r.meetings,null,3);
else
document.getElementById('result').innerHTML = "There are no upcoming meetings on your schedule.";
});
});
}
</script>
<script class="pre">
hello.init({
joinme : JOINME_CLIENT_ID
}, {
redirect_uri : '../redirect.html',
scope : 'user,scheduler'
});
</script>