-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
70 lines (68 loc) · 1.77 KB
/
index.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head>
<title>Desktop Notification Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="nw-desktop-notifications.js"></script>
</head>
<style type="text/css">
body {
font-family : Helvetica, Arial, sans-serif;
background-color: #ccc;
color: #333;
margin: none;
padding: 30px;
}
input[type=text] {
width: 450px;
border-radius: 3px;
height: 25px;
border: 1px solid #999;
padding: 4px;
font-size: 12px;
}
#status {
border: 1px solid #84C03A;
background-color: #D1FCB3;
border-radius: 3px;
padding: 4px;
color: #84C03A;
font-size: 12px;
}
</style>
<body>
<h1>Desktop Notifications Demo</h1>
<form id='nwdemo' action='#' method='post'>
<p>
<label>Title:</label><br />
<input name='title' type='text' value='Some Title'/>
</p>
<p>
<label>Content:</label><br />
<input name='content' type='text' value='Testing of desktop notifications'/>
</p>
<p>
<label>Icon Url:</label><br />
<input name='icon' type='text' value='desktop-notify.png'/>
</p>
<input type='submit' value='Notify »'/>
</form>
<div id='status' style='display: none;'></div>
<script type="text/javascript">
$('#nwdemo').submit(function(e){
e.preventDefault();
var form = $(this);
var icon = form.find('input[name=icon]').val();
var title = form.find('input[name=title]').val();
var content = form.find('input[name=content]').val();
window.LOCAL_NW.desktopNotifications.notify(icon, title, content, function(){
$('#status').text('Clicked on '+title);
$('#status').fadeIn('fast',function(){
setTimeout(function(){
$('#status').fadeOut('fast');
},1800);
});
});
});
</script>
</body>
</html>