forked from MrSwitch/hello.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.html
40 lines (33 loc) · 1.22 KB
/
profile.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
<!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.js"></script>
<script src="../src/hello.then.js"></script>
<script src="../src/modules/windows.js"></script>
<script src="../src/modules/facebook.js"></script>
<script src="../src/modules/google.js"></script>
<h1>hello.api( me )</h1>
<button id='google' onclick="hello.login('google');">google</button>
<button id='facebook' onclick="hello.login('facebook');">facebook</button>
<button id='windows' onclick="hello.login('windows');">windows</button>
<p>Listen to the event "auth.login", and call <code>hello( network ).api( 'me' ).then( handler )</code></p>
<script class="pre">
hello.on('auth.login', function(r){
// Get Profile
hello( r.network ).api( '/me' ).then( function(p){
var label = document.getElementById(r.network)
label.innerHTML = "<img src='"+ p.thumbnail + "' width=24/>Connected to "+ r.network+" as " + p.name;
});
});
</script>
<p>Intiate App credentials</p>
<script class="pre">
hello.init({
google : CLIENT_IDS.google,
windows : CLIENT_IDS.windows,
facebook : CLIENT_IDS.facebook
},{
redirect_uri:'../redirect.html'
});
</script>