/
notification.html
55 lines (44 loc) · 1.39 KB
/
notification.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
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<title>PGB Kitchen Sink</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div data-role="page" id="pageNotifications" data-cache="never">
<script type="text/javascript" charset="utf-8">
//http://docs.phonegap.com/en/2.3.0/cordova_events_events.md.html#Events
$("#pageNotifications").bind('pageshow', function() {
});
// Show a custom alert
//
function showAlert() {
navigator.notification.alert(
'You are the winner!', // message
'Game Over', // title
'Done' // buttonName
);
}
// Beep three times
//
function playBeep() {
navigator.notification.beep(2);
}
// Vibrate for 2 seconds
//
function vibrate() {
navigator.notification.vibrate(1000);
}
</script>
<div data-role="header">
<h1>Notifications</h1>
</div><!-- /header -->
<div data-role="content">
<p><a href="#" onclick="showAlert(); return false;" data-role="button">Show Alert</a></p>
<p><a href="#" onclick="playBeep(); return false;" data-role="button">Play Beep</a></p>
<p><a href="#" onclick="vibrate(); return false;" data-role="button">Vibrate</a></p>
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>