-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
112 lines (101 loc) · 7.34 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<html>
<head>
<title>Test HTML5 Desktop Notification Plugin</title>
<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jwNotify.js"></script>
<script type="text/javascript">
$(function(){
$('#simple_notify_button').click(function(e){
e.preventDefault();
$.jwNotify({
image: $('form#simple_notify #image').val(),
title: $('form#simple_notify #title').val(),
body: $('form#simple_notify #body').val(),
dir: $('form#simple_notify #dir').val(),
onshow: function(){
console.log('function closed');
}
});
});
$('#html_notify_button').click(function(e){
e.preventDefault();
$.jwNotifyHTML({
url: $('form#html_notify #url').val()
});
});
});
</script>
</head>
<body>
<h2>jQuery HTML5 Desktop Notification</h2>
<h5>Links:</h5>
<ul>
<li><a href="http://athousandnodes.com">a thousnad nodes..</a></li>
<li><a href="http://plugins.jquery.com/project/desktop-notification">Desktop Notify Plugin page</a></li>
</ul>
<div class="content clearfix">
<p>This jQuery Plugin makes it easier to generate HTML5 Desktop Notifications.<br>
The Plugin is still under development. More features are being added currently</p>
<p>The notifications have been timed to stay for default duration</p>
<b>Simple Notification</b>
<form id="simple_notify" onSubmit="false">
<table>
<tr>
<td><lable>Image</lable></td>
<td><input id="image" value="testpilot.png" /></td>
</tr>
<tr>
<td><lable>Title</lable></td>
<td><input id="title" value="Test Title" /></td>
</tr>
<tr>
<td><lable>Message</lable></td>
<td><input id="body" value="Test Body" /></td>
</tr>
<tr>
<td><lable>Direction</lable></td>
<td>
<select id="dir" value="Test Body">
<option value="ltr">ltr</option>
<option value="rtl">rtl</option>
</select></td>
</tr>
<tr>
<td colspan="2"><button id="simple_notify_button">Show Notification</button></td>
</tr>
</table>
</form>
<b>HTML Notification</b>
<form id="html_notify" onSubmit="false">
<table>
<tr>
<td><lable>URL</lable></td>
<td><input id="url" value="test.html" /></td>
</tr>
<tr>
<td colspan="2"><button id="html_notify_button">Show Notification</button></td>
</tr>
</table>
</form>
<p>Basic Usage(Simple Notification):</p>
<div class="codeblock"><code>$.jwNotify({<br> image : 'path-to-image-file',<br> title: 'title-to-be-shown',<br> body: 'body-of-the-notification',<br> timeout: 10000<br>});</code></div>
<p>Basic Usage(HTML Notification):</p>
<div class="codeblock"><code>$.jwNotifyHTML({<br> url: 'url-to-the-page-to-be-shown-in-notification',<br> timeout: 10000<br>});</code></div>
<p>Available Options and their Defaults(Simple Notification):</p>
<div class="codeblock"><code>image : null, //Image to be shown in the notification area<br>title: null, //Title<br>body: null, //Body of the notification to be shown<br>timeout: 5000, //Time in milliseconds for which this notification should be shown; A value equal to 0 will make it the notification persistent<br>dir : null, //Direction(rlt, ltr) of the text shown in the<br> //notification<br>onclick: null, //Callback for onclick event on the notification<br>onshow: null, //Callback for onshow event<br>onerror: null, //Callback for onerror event<br>onclose: null, //Callback for onclose event<br>id: null //Identifier for the notifiction. <br> //This is used to identify the notification<br> //message shown.</code></div>
<p>Available Options and their Defaults(HTML Notification):</p>
<div class="codeblock"><code>url: null //URL of the page to be shown in the notification<br>timeout: 5000, //Time in milliseconds for which this notification should be shown; A value equal to 0 will make the notification persistent <br>onclick: null, //Callback for onclick event on the notification<br>onshow: null, //Callback for onshow event<br>onerror: null, //Callback for onerror event<br>onclose: null, //Callback for onclose event<br>id: null //Identifier for the notifiction. <br> //This is used to identify the notification<br> //message shown.</code></div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10965684-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>