-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
52 lines (44 loc) · 1.23 KB
/
index.html
File metadata and controls
52 lines (44 loc) · 1.23 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
<!DOCTYPE html>
<html>
<head>
<title>otxtapp</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Persona Test</h1>
<button id="signin">Signin</button>
<button id="signout">Signout</button>
<button id="launch" onclick="launchPopup()">Open Popup</button>
<script src="phonegap.js"></script>
<script src="https://login.persona.org/include.js"></script>
<script>
var w;
function launchPopup() {
w = window.open("http://google.com/", '_blank');
w.addEventListener('exit', function(event) { alert('Popup Closed'); } );
}
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
alert('DeviceReady');
}
var currentUser = 'sandeep.shetty@gmail.com';
navigator.id.watch({
loggedInUser: currentUser,
onlogin: function(assertion) {
alert('onlogin');
},
onlogout: function() {
alert('onlogout');
}
});
var signinLink = document.getElementById('signin');
if (signinLink) {
signinLink.onclick = function() { navigator.id.request(); };
}
var signoutLink = document.getElementById('signout');
if (signoutLink) {
signoutLink.onclick = function() { navigator.id.logout(); };
}
</script>
</body>
</html>