Commit ccc2ad34 by Sebastián Katzer

Update index.html

parent 112c3d93
...@@ -42,86 +42,86 @@ ...@@ -42,86 +42,86 @@
<!-- permission --> <!-- permission -->
<h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2> <h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2>
<div class="container"> <div class="container">
<div onclick="hasPermission()">Granted?<br/><span>hasPermission()</span></div> <div onclick="hasPermission()">Granted?<br /><span>hasPermission()</span></div>
<div onclick="registerPermission()">Register<br/><span>registerPermission()</span></div> <div onclick="registerPermission()">Register<br /><span>registerPermission()</span></div>
</div> </div>
<!-- schedule --> <!-- schedule -->
<h2 class="section">Schedule</h2> <h2 class="section">Schedule</h2>
<div class="container"> <div class="container">
<div onclick="schedule()">Single<br/><span>schedule(1)</span></div> <div onclick="schedule()">Single<br /><span>schedule(1)</span></div>
<div onclick="scheduleMultiple()">Multiple<br/><span>schedule(1, 2, 3)</span></div> <div onclick="scheduleMultiple()">Multiple<br /><span>schedule(1, 2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="scheduleDelayed()">In 5 sec<br/><span>schedule(1, firstAt:later)</span></div> <div onclick="scheduleDelayed()">In 5 sec<br /><span>schedule(1, firstAt:later)</span></div>
<div onclick="scheduleMinutely()">Every min<br/><span>schedule(1, every:minute)</span></div> <div onclick="scheduleMinutely()">Every min<br /><span>schedule(1, every:minute)</span></div>
</div> </div>
<!-- update --> <!-- update -->
<h2 class="section">Update</h2> <h2 class="section">Update</h2>
<div class="container"> <div class="container">
<div onclick="update()">Title<br/><span>update(1)</span></div> <div onclick="update()">Title<br /><span>update(1)</span></div>
<div onclick="updateInterval()">Interval<br/><span>update(1, every:minute)</span></div> <div onclick="updateInterval()">Interval<br /><span>update(1, every:minute)</span></div>
</div> </div>
<!-- clear --> <!-- clear -->
<h2 class="section">Clear</h2> <h2 class="section">Clear</h2>
<div class="container"> <div class="container">
<div onclick="clearSingle()">Single<br/><span>clear(1)</span></div> <div onclick="clearSingle()">Single<br /><span>clear(1)</span></div>
<div onclick="clearMultiple()">Multiple<br/><span>clear(2, 3)</span></div> <div onclick="clearMultiple()">Multiple<br /><span>clear(2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="clearAll()">All<br/><span>clearAll()</span></div> <div onclick="clearAll()">All<br /><span>clearAll()</span></div>
</div> </div>
<!-- cancel --> <!-- cancel -->
<h2 class="section">Cancel</h2> <h2 class="section">Cancel</h2>
<div class="container"> <div class="container">
<div onclick="cancel()">Single<br/><span>cancel(1)</span></div> <div onclick="cancel()">Single<br /><span>cancel(1)</span></div>
<div onclick="cancelMultiple()">Multiple<br/><span>cancel(2, 3)</span></div> <div onclick="cancelMultiple()">Multiple<br /><span>cancel(2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="cancelAll()">All<br/><span>cancelAll()</span></div> <div onclick="cancelAll()">All<br /><span>cancelAll()</span></div>
</div> </div>
<!-- presence --> <!-- presence -->
<h2 class="section">Presence</h2> <h2 class="section">Presence</h2>
<div class="container"> <div class="container">
<div onclick="isScheduled()">Scheduled?<br/><span>isScheduled(1)</span></div> <div onclick="isScheduled()">Scheduled?<br /><span>isScheduled(1)</span></div>
<div onclick="isTriggered()">Triggered?<br/><span>isTrigered(1)</span></div> <div onclick="isTriggered()">Triggered?<br /><span>isTrigered(1)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="isPresent()">Present?<br/><span>present(1)</span></div> <div onclick="isPresent()">Present?<br /><span>present(1)</span></div>
</div> </div>
<!-- id's --> <!-- id's -->
<h2 class="section">ID's</h2> <h2 class="section">ID's</h2>
<div class="container"> <div class="container">
<div onclick="getScheduledIds()">Scheduled<br/><span>getScheduledIds()</span></div> <div onclick="getScheduledIds()">Scheduled<br /><span>getScheduledIds()</span></div>
<div onclick="getTriggeredIds()">Triggered<br/><span>getTriggeredIds()</span></div> <div onclick="getTriggeredIds()">Triggered<br /><span>getTriggeredIds()</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="getIds()">All<br/><span>getIds()</span></div> <div onclick="getIds()">All<br /><span>getIds()</span></div>
</div> </div>
<!-- notifications --> <!-- notifications -->
<h2 class="section">Notifications</h2> <h2 class="section">Notifications</h2>
<div class="container"> <div class="container">
<div onclick="getScheduled()">Scheduled<br/><span>getScheduled()</span></div> <div onclick="getScheduled()">Scheduled<br /><span>getScheduled()</span></div>
<div onclick="getTriggered()">Triggered<br/><span>getTrigered()</span></div> <div onclick="getTriggered()">Triggered<br /><span>getTrigered()</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="get()">Single<br/><span>get(1)</span></div> <div onclick="get()">Single<br /><span>get(1)</span></div>
<div onclick="getMultiple()">Multiple<br/><span>get(1, 2)</span></div> <div onclick="getMultiple()">Multiple<br /><span>get(1, 2)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="getAll()">All<br/><span>getAll()</span></div> <div onclick="getAll()">All<br /><span>getAll()</span></div>
</div> </div>
<!-- defaults --> <!-- defaults -->
<h2 class="section">Defaults</h2> <h2 class="section">Defaults</h2>
<div class="container"> <div class="container">
<div onclick="setDefaultTitle()">Change title<br/><span>setDefaults(title:"...")</span></div> <div onclick="setDefaultTitle()">Change title<br /><span>setDefaults(title:"...")</span></div>
</div> </div>
<!-- copyright --> <!-- copyright -->
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<script type="text/javascript" src="js/index.js"></script> <script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var id = 1; var id = 1, dialog;
callback = function () { callback = function () {
cordova.plugins.notification.local.getIds(function (ids) { cordova.plugins.notification.local.getIds(function (ids) {
...@@ -144,23 +144,40 @@ ...@@ -144,23 +144,40 @@
showToast = function (text) { showToast = function (text) {
setTimeout(function () { setTimeout(function () {
window.plugins.toast.showShortBottom(text); if (device.platform != 'windows') {
window.plugins.toast.showShortBottom(text);
} else {
showDialog(text);
}
}, 100); }, 100);
}; };
</script> showDialog = function (text) {
if (dialog) {
dialog.content = text;
return;
}
dialog = new Windows.UI.Popups.MessageDialog(text);
dialog.showAsync().done(function () {
dialog = null;
});
};
</script>
<!-- permission --> <!-- permission -->
<script type="text/javascript"> <script type="text/javascript">
hasPermission = function () { hasPermission = function () {
cordova.plugins.notification.local.hasPermission(function (granted) { cordova.plugins.notification.local.hasPermission(function (granted) {
alert(granted); showToast(granted ? 'Yes' : 'No');
}); });
}; };
registerPermission = function () { registerPermission = function () {
cordova.plugins.notification.local.registerPermission(function (granted) { cordova.plugins.notification.local.registerPermission(function (granted) {
alert(granted); showToast(granted ? 'Yes' : 'No');
}); });
}; };
</script> </script>
...@@ -169,38 +186,38 @@ ...@@ -169,38 +186,38 @@
<script type="text/javascript"> <script type="text/javascript">
schedule = function () { schedule = function () {
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
text: 'Test Message 1', text: 'Test Message 1',
icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png', icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png',
sound: null, sound: null,
data: { test:id } data: { test: id }
}); });
}; };
scheduleMultiple = function () { scheduleMultiple = function () {
cordova.plugins.notification.local.schedule([{ cordova.plugins.notification.local.schedule([{
id: 1, id: 1,
text: 'Multi Message 1' text: 'Multi Message 1'
},{ }, {
id: 2, id: 2,
text: 'Multi Message 2' text: 'Multi Message 2'
},{ }, {
id: 3, id: 3,
text: 'Multi Message 3' text: 'Multi Message 3'
}]); }]);
}; };
scheduleDelayed = function () { scheduleDelayed = function () {
var now = new Date().getTime(), var now = new Date().getTime(),
_5_sec_from_now = new Date(now + 5*1000); _5_sec_from_now = new Date(now + 5 * 1000);
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf'; var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
title: 'Scheduled with delay', title: 'Scheduled with delay',
text: 'Test Message 1', text: 'Test Message 1',
at: _5_sec_from_now, at: _5_sec_from_now,
sound: sound sound: sound
}); });
}; };
...@@ -209,8 +226,8 @@ ...@@ -209,8 +226,8 @@
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf'; var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
text: 'Scheduled every minute', text: 'Scheduled every minute',
every: 'minute', every: 'minute',
sound: sound sound: sound
}); });
...@@ -221,16 +238,16 @@ ...@@ -221,16 +238,16 @@
<script type="text/javascript"> <script type="text/javascript">
update = function () { update = function () {
cordova.plugins.notification.local.update({ cordova.plugins.notification.local.update({
id: 1, id: 1,
text: 'Updated Message 1', text: 'Updated Message 1',
json: { updated:true } json: { updated: true }
}); });
}; };
updateInterval = function () { updateInterval = function () {
cordova.plugins.notification.local.update({ cordova.plugins.notification.local.update({
id: 1, id: 1,
text: 'Updated Message 1', text: 'Updated Message 1',
every: 'minute' every: 'minute'
}); });
}; };
...@@ -239,11 +256,11 @@ ...@@ -239,11 +256,11 @@
<!-- clear --> <!-- clear -->
<script type="text/javascript"> <script type="text/javascript">
clearSingle = function () { clearSingle = function () {
cordova.plugins.notification.local.clear(1,callback); cordova.plugins.notification.local.clear(1, callback);
}; };
clearMultiple = function () { clearMultiple = function () {
cordova.plugins.notification.local.clear([2, 3],callback); cordova.plugins.notification.local.clear([2, 3], callback);
}; };
clearAll = function () { clearAll = function () {
...@@ -254,11 +271,11 @@ ...@@ -254,11 +271,11 @@
<!-- cancel --> <!-- cancel -->
<script type="text/javascript"> <script type="text/javascript">
cancel = function () { cancel = function () {
cordova.plugins.notification.local.cancel(1,callback); cordova.plugins.notification.local.cancel(1, callback);
}; };
cancelMultiple = function () { cancelMultiple = function () {
cordova.plugins.notification.local.cancel([2, 3],callback); cordova.plugins.notification.local.cancel([2, 3], callback);
}; };
cancelAll = function () { cancelAll = function () {
...@@ -290,8 +307,8 @@ ...@@ -290,8 +307,8 @@
<!-- IDs --> <!-- IDs -->
<script type="text/javascript"> <script type="text/javascript">
var callbackIds = function (ids) { var callbackIds = function (ids) {
showToast(ids.length === 0 ? '- none -' : ids.join(' ,')); showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
}; };
getIds = function () { getIds = function () {
cordova.plugins.notification.local.getIds(callbackIds); cordova.plugins.notification.local.getIds(callbackIds);
...@@ -309,9 +326,9 @@ ...@@ -309,9 +326,9 @@
<!-- notifications --> <!-- notifications -->
<script type="text/javascript"> <script type="text/javascript">
var callbackOpts = function (notifications) { var callbackOpts = function (notifications) {
console.log(notifications); console.log(notifications);
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,')); showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
}; };
get = function () { get = function () {
cordova.plugins.notification.local.get(1, callbackOpts); cordova.plugins.notification.local.get(1, callbackOpts);
......
...@@ -42,86 +42,86 @@ ...@@ -42,86 +42,86 @@
<!-- permission --> <!-- permission -->
<h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2> <h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2>
<div class="container"> <div class="container">
<div onclick="hasPermission()">Granted?<br/><span>hasPermission()</span></div> <div onclick="hasPermission()">Granted?<br /><span>hasPermission()</span></div>
<div onclick="registerPermission()">Register<br/><span>registerPermission()</span></div> <div onclick="registerPermission()">Register<br /><span>registerPermission()</span></div>
</div> </div>
<!-- schedule --> <!-- schedule -->
<h2 class="section">Schedule</h2> <h2 class="section">Schedule</h2>
<div class="container"> <div class="container">
<div onclick="schedule()">Single<br/><span>schedule(1)</span></div> <div onclick="schedule()">Single<br /><span>schedule(1)</span></div>
<div onclick="scheduleMultiple()">Multiple<br/><span>schedule(1, 2, 3)</span></div> <div onclick="scheduleMultiple()">Multiple<br /><span>schedule(1, 2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="scheduleDelayed()">In 5 sec<br/><span>schedule(1, firstAt:later)</span></div> <div onclick="scheduleDelayed()">In 5 sec<br /><span>schedule(1, firstAt:later)</span></div>
<div onclick="scheduleMinutely()">Every min<br/><span>schedule(1, every:minute)</span></div> <div onclick="scheduleMinutely()">Every min<br /><span>schedule(1, every:minute)</span></div>
</div> </div>
<!-- update --> <!-- update -->
<h2 class="section">Update</h2> <h2 class="section">Update</h2>
<div class="container"> <div class="container">
<div onclick="update()">Title<br/><span>update(1)</span></div> <div onclick="update()">Title<br /><span>update(1)</span></div>
<div onclick="updateInterval()">Interval<br/><span>update(1, every:minute)</span></div> <div onclick="updateInterval()">Interval<br /><span>update(1, every:minute)</span></div>
</div> </div>
<!-- clear --> <!-- clear -->
<h2 class="section">Clear</h2> <h2 class="section">Clear</h2>
<div class="container"> <div class="container">
<div onclick="clearSingle()">Single<br/><span>clear(1)</span></div> <div onclick="clearSingle()">Single<br /><span>clear(1)</span></div>
<div onclick="clearMultiple()">Multiple<br/><span>clear(2, 3)</span></div> <div onclick="clearMultiple()">Multiple<br /><span>clear(2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="clearAll()">All<br/><span>clearAll()</span></div> <div onclick="clearAll()">All<br /><span>clearAll()</span></div>
</div> </div>
<!-- cancel --> <!-- cancel -->
<h2 class="section">Cancel</h2> <h2 class="section">Cancel</h2>
<div class="container"> <div class="container">
<div onclick="cancel()">Single<br/><span>cancel(1)</span></div> <div onclick="cancel()">Single<br /><span>cancel(1)</span></div>
<div onclick="cancelMultiple()">Multiple<br/><span>cancel(2, 3)</span></div> <div onclick="cancelMultiple()">Multiple<br /><span>cancel(2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="cancelAll()">All<br/><span>cancelAll()</span></div> <div onclick="cancelAll()">All<br /><span>cancelAll()</span></div>
</div> </div>
<!-- presence --> <!-- presence -->
<h2 class="section">Presence</h2> <h2 class="section">Presence</h2>
<div class="container"> <div class="container">
<div onclick="isScheduled()">Scheduled?<br/><span>isScheduled(1)</span></div> <div onclick="isScheduled()">Scheduled?<br /><span>isScheduled(1)</span></div>
<div onclick="isTriggered()">Triggered?<br/><span>isTrigered(1)</span></div> <div onclick="isTriggered()">Triggered?<br /><span>isTrigered(1)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="isPresent()">Present?<br/><span>present(1)</span></div> <div onclick="isPresent()">Present?<br /><span>present(1)</span></div>
</div> </div>
<!-- id's --> <!-- id's -->
<h2 class="section">ID's</h2> <h2 class="section">ID's</h2>
<div class="container"> <div class="container">
<div onclick="getScheduledIds()">Scheduled<br/><span>getScheduledIds()</span></div> <div onclick="getScheduledIds()">Scheduled<br /><span>getScheduledIds()</span></div>
<div onclick="getTriggeredIds()">Triggered<br/><span>getTriggeredIds()</span></div> <div onclick="getTriggeredIds()">Triggered<br /><span>getTriggeredIds()</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="getIds()">All<br/><span>getIds()</span></div> <div onclick="getIds()">All<br /><span>getIds()</span></div>
</div> </div>
<!-- notifications --> <!-- notifications -->
<h2 class="section">Notifications</h2> <h2 class="section">Notifications</h2>
<div class="container"> <div class="container">
<div onclick="getScheduled()">Scheduled<br/><span>getScheduled()</span></div> <div onclick="getScheduled()">Scheduled<br /><span>getScheduled()</span></div>
<div onclick="getTriggered()">Triggered<br/><span>getTrigered()</span></div> <div onclick="getTriggered()">Triggered<br /><span>getTrigered()</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="get()">Single<br/><span>get(1)</span></div> <div onclick="get()">Single<br /><span>get(1)</span></div>
<div onclick="getMultiple()">Multiple<br/><span>get(1, 2)</span></div> <div onclick="getMultiple()">Multiple<br /><span>get(1, 2)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="getAll()">All<br/><span>getAll()</span></div> <div onclick="getAll()">All<br /><span>getAll()</span></div>
</div> </div>
<!-- defaults --> <!-- defaults -->
<h2 class="section">Defaults</h2> <h2 class="section">Defaults</h2>
<div class="container"> <div class="container">
<div onclick="setDefaultTitle()">Change title<br/><span>setDefaults(title:"...")</span></div> <div onclick="setDefaultTitle()">Change title<br /><span>setDefaults(title:"...")</span></div>
</div> </div>
<!-- copyright --> <!-- copyright -->
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<script type="text/javascript" src="js/index.js"></script> <script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var id = 1; var id = 1, dialog;
callback = function () { callback = function () {
cordova.plugins.notification.local.getIds(function (ids) { cordova.plugins.notification.local.getIds(function (ids) {
...@@ -144,23 +144,40 @@ ...@@ -144,23 +144,40 @@
showToast = function (text) { showToast = function (text) {
setTimeout(function () { setTimeout(function () {
window.plugins.toast.showShortBottom(text); if (device.platform != 'windows') {
window.plugins.toast.showShortBottom(text);
} else {
showDialog(text);
}
}, 100); }, 100);
}; };
</script> showDialog = function (text) {
if (dialog) {
dialog.content = text;
return;
}
dialog = new Windows.UI.Popups.MessageDialog(text);
dialog.showAsync().done(function () {
dialog = null;
});
};
</script>
<!-- permission --> <!-- permission -->
<script type="text/javascript"> <script type="text/javascript">
hasPermission = function () { hasPermission = function () {
cordova.plugins.notification.local.hasPermission(function (granted) { cordova.plugins.notification.local.hasPermission(function (granted) {
alert(granted); showToast(granted ? 'Yes' : 'No');
}); });
}; };
registerPermission = function () { registerPermission = function () {
cordova.plugins.notification.local.registerPermission(function (granted) { cordova.plugins.notification.local.registerPermission(function (granted) {
alert(granted); showToast(granted ? 'Yes' : 'No');
}); });
}; };
</script> </script>
...@@ -169,38 +186,38 @@ ...@@ -169,38 +186,38 @@
<script type="text/javascript"> <script type="text/javascript">
schedule = function () { schedule = function () {
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
text: 'Test Message 1', text: 'Test Message 1',
icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png', icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png',
sound: null, sound: null,
data: { test:id } data: { test: id }
}); });
}; };
scheduleMultiple = function () { scheduleMultiple = function () {
cordova.plugins.notification.local.schedule([{ cordova.plugins.notification.local.schedule([{
id: 1, id: 1,
text: 'Multi Message 1' text: 'Multi Message 1'
},{ }, {
id: 2, id: 2,
text: 'Multi Message 2' text: 'Multi Message 2'
},{ }, {
id: 3, id: 3,
text: 'Multi Message 3' text: 'Multi Message 3'
}]); }]);
}; };
scheduleDelayed = function () { scheduleDelayed = function () {
var now = new Date().getTime(), var now = new Date().getTime(),
_5_sec_from_now = new Date(now + 5*1000); _5_sec_from_now = new Date(now + 5 * 1000);
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf'; var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
title: 'Scheduled with delay', title: 'Scheduled with delay',
text: 'Test Message 1', text: 'Test Message 1',
at: _5_sec_from_now, at: _5_sec_from_now,
sound: sound sound: sound
}); });
}; };
...@@ -209,8 +226,8 @@ ...@@ -209,8 +226,8 @@
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf'; var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
text: 'Scheduled every minute', text: 'Scheduled every minute',
every: 'minute', every: 'minute',
sound: sound sound: sound
}); });
...@@ -221,16 +238,16 @@ ...@@ -221,16 +238,16 @@
<script type="text/javascript"> <script type="text/javascript">
update = function () { update = function () {
cordova.plugins.notification.local.update({ cordova.plugins.notification.local.update({
id: 1, id: 1,
text: 'Updated Message 1', text: 'Updated Message 1',
json: { updated:true } json: { updated: true }
}); });
}; };
updateInterval = function () { updateInterval = function () {
cordova.plugins.notification.local.update({ cordova.plugins.notification.local.update({
id: 1, id: 1,
text: 'Updated Message 1', text: 'Updated Message 1',
every: 'minute' every: 'minute'
}); });
}; };
...@@ -239,11 +256,11 @@ ...@@ -239,11 +256,11 @@
<!-- clear --> <!-- clear -->
<script type="text/javascript"> <script type="text/javascript">
clearSingle = function () { clearSingle = function () {
cordova.plugins.notification.local.clear(1,callback); cordova.plugins.notification.local.clear(1, callback);
}; };
clearMultiple = function () { clearMultiple = function () {
cordova.plugins.notification.local.clear([2, 3],callback); cordova.plugins.notification.local.clear([2, 3], callback);
}; };
clearAll = function () { clearAll = function () {
...@@ -254,11 +271,11 @@ ...@@ -254,11 +271,11 @@
<!-- cancel --> <!-- cancel -->
<script type="text/javascript"> <script type="text/javascript">
cancel = function () { cancel = function () {
cordova.plugins.notification.local.cancel(1,callback); cordova.plugins.notification.local.cancel(1, callback);
}; };
cancelMultiple = function () { cancelMultiple = function () {
cordova.plugins.notification.local.cancel([2, 3],callback); cordova.plugins.notification.local.cancel([2, 3], callback);
}; };
cancelAll = function () { cancelAll = function () {
...@@ -290,8 +307,8 @@ ...@@ -290,8 +307,8 @@
<!-- IDs --> <!-- IDs -->
<script type="text/javascript"> <script type="text/javascript">
var callbackIds = function (ids) { var callbackIds = function (ids) {
showToast(ids.length === 0 ? '- none -' : ids.join(' ,')); showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
}; };
getIds = function () { getIds = function () {
cordova.plugins.notification.local.getIds(callbackIds); cordova.plugins.notification.local.getIds(callbackIds);
...@@ -309,9 +326,9 @@ ...@@ -309,9 +326,9 @@
<!-- notifications --> <!-- notifications -->
<script type="text/javascript"> <script type="text/javascript">
var callbackOpts = function (notifications) { var callbackOpts = function (notifications) {
console.log(notifications); console.log(notifications);
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,')); showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
}; };
get = function () { get = function () {
cordova.plugins.notification.local.get(1, callbackOpts); cordova.plugins.notification.local.get(1, callbackOpts);
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup /> <PropertyGroup>
<ReferenceCachePath>C:\Users\sebastian\AppData\Local\Temp\yxmokjnx_CordovaApp.Phone_refcache</ReferenceCachePath>
</PropertyGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup /> <PropertyGroup>
<ReferenceCachePath>C:\Users\sebastian\AppData\Local\Temp\anloqo42_CordovaApp.Windows_refcache</ReferenceCachePath>
</PropertyGroup>
</Project> </Project>
\ No newline at end of file
...@@ -20,395 +20,395 @@ ...@@ -20,395 +20,395 @@
under the License. under the License.
--> -->
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" /> <meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" /> <meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 --> <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" /> <link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Notification Example</title> <title>Notification Example</title>
</head> </head>
<body> <body>
<div> <div>
<div class="app"> <div class="app">
<h1>Local-Notification Example</h1> <h1>Local-Notification Example</h1>
<div id="deviceready" class="blink"> <div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p> <p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p> <p class="event received">Device is Ready</p>
</div>
</div>
<!-- permission -->
<h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2>
<div class="container">
<div onclick="hasPermission()">Granted?<br /><span>hasPermission()</span></div>
<div onclick="registerPermission()">Register<br /><span>registerPermission()</span></div>
</div>
<!-- schedule -->
<h2 class="section">Schedule</h2>
<div class="container">
<div onclick="schedule()">Single<br /><span>schedule(1)</span></div>
<div onclick="scheduleMultiple()">Multiple<br /><span>schedule(1, 2, 3)</span></div>
</div>
<div class="container">
<div onclick="scheduleDelayed()">In 5 sec<br /><span>schedule(1, firstAt:later)</span></div>
<div onclick="scheduleMinutely()">Every min<br /><span>schedule(1, every:minute)</span></div>
</div>
<!-- update -->
<h2 class="section">Update</h2>
<div class="container">
<div onclick="update()">Title<br /><span>update(1)</span></div>
<div onclick="updateInterval()">Interval<br /><span>update(1, every:minute)</span></div>
</div>
<!-- clear -->
<h2 class="section">Clear</h2>
<div class="container">
<div onclick="clearSingle()">Single<br /><span>clear(1)</span></div>
<div onclick="clearMultiple()">Multiple<br /><span>clear(2, 3)</span></div>
</div>
<div class="container">
<div onclick="clearAll()">All<br /><span>clearAll()</span></div>
</div>
<!-- cancel -->
<h2 class="section">Cancel</h2>
<div class="container">
<div onclick="cancel()">Single<br /><span>cancel(1)</span></div>
<div onclick="cancelMultiple()">Multiple<br /><span>cancel(2, 3)</span></div>
</div>
<div class="container">
<div onclick="cancelAll()">All<br /><span>cancelAll()</span></div>
</div>
<!-- presence -->
<h2 class="section">Presence</h2>
<div class="container">
<div onclick="isScheduled()">Scheduled?<br /><span>isScheduled(1)</span></div>
<div onclick="isTriggered()">Triggered?<br /><span>isTrigered(1)</span></div>
</div>
<div class="container">
<div onclick="isPresent()">Present?<br /><span>present(1)</span></div>
</div>
<!-- id's -->
<h2 class="section">ID's</h2>
<div class="container">
<div onclick="getScheduledIds()">Scheduled<br /><span>getScheduledIds()</span></div>
<div onclick="getTriggeredIds()">Triggered<br /><span>getTriggeredIds()</span></div>
</div>
<div class="container">
<div onclick="getIds()">All<br /><span>getIds()</span></div>
</div>
<!-- notifications -->
<h2 class="section">Notifications</h2>
<div class="container">
<div onclick="getScheduled()">Scheduled<br /><span>getScheduled()</span></div>
<div onclick="getTriggered()">Triggered<br /><span>getTrigered()</span></div>
</div>
<div class="container">
<div onclick="get()">Single<br /><span>get(1)</span></div>
<div onclick="getMultiple()">Multiple<br /><span>get(1, 2)</span></div>
</div>
<div class="container">
<div onclick="getAll()">All<br /><span>getAll()</span></div>
</div>
<!-- defaults -->
<h2 class="section">Defaults</h2>
<div class="container">
<div onclick="setDefaultTitle()">Change title<br /><span>setDefaults(title:"...")</span></div>
</div>
<!-- copyright -->
<div class="copyright">
© 2013-2015 appPlant
</div> </div>
</div> </div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
var id = 1, dialog;
callback = function () {
cordova.plugins.notification.local.getIds(function (ids) {
showToast('IDs: ' + ids.join(' ,'));
});
};
showToast = function (text) {
setTimeout(function () {
if (device.platform != 'windows') {
window.plugins.toast.showShortBottom(text);
} else {
showDialog(text);
}
}, 100);
};
showDialog = function (text) {
if (dialog) {
dialog.content = text;
return;
}
dialog = new Windows.UI.Popups.MessageDialog(text);
dialog.showAsync().done(function () {
dialog = null;
});
};
</script>
<!-- permission --> <!-- permission -->
<h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2> <script type="text/javascript">
<div class="container"> hasPermission = function () {
<div onclick="hasPermission()">Granted?<br /><span>hasPermission()</span></div> cordova.plugins.notification.local.hasPermission(function (granted) {
<div onclick="registerPermission()">Register<br /><span>registerPermission()</span></div> showToast(granted ? 'Yes' : 'No');
</div> });
};
registerPermission = function () {
cordova.plugins.notification.local.registerPermission(function (granted) {
showToast(granted ? 'Yes' : 'No');
});
};
</script>
<!-- schedule --> <!-- schedule -->
<h2 class="section">Schedule</h2> <script type="text/javascript">
<div class="container"> schedule = function () {
<div onclick="schedule()">Single<br /><span>schedule(1)</span></div> cordova.plugins.notification.local.schedule({
<div onclick="scheduleMultiple()">Multiple<br /><span>schedule(1, 2, 3)</span></div> id: 1,
</div> text: 'Test Message 1',
<div class="container"> icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png',
<div onclick="scheduleDelayed()">In 5 sec<br /><span>schedule(1, firstAt:later)</span></div> sound: null,
<div onclick="scheduleMinutely()">Every min<br /><span>schedule(1, every:minute)</span></div> data: { test: id }
</div> });
};
scheduleMultiple = function () {
cordova.plugins.notification.local.schedule([{
id: 1,
text: 'Multi Message 1'
}, {
id: 2,
text: 'Multi Message 2'
}, {
id: 3,
text: 'Multi Message 3'
}]);
};
scheduleDelayed = function () {
var now = new Date().getTime(),
_5_sec_from_now = new Date(now + 5 * 1000);
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({
id: 1,
title: 'Scheduled with delay',
text: 'Test Message 1',
at: _5_sec_from_now,
sound: sound
});
};
scheduleMinutely = function () {
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({
id: 1,
text: 'Scheduled every minute',
every: 'minute',
sound: sound
});
};
</script>
<!-- update --> <!-- update -->
<h2 class="section">Update</h2> <script type="text/javascript">
<div class="container"> update = function () {
<div onclick="update()">Title<br /><span>update(1)</span></div> cordova.plugins.notification.local.update({
<div onclick="updateInterval()">Interval<br /><span>update(1, every:minute)</span></div> id: 1,
</div> text: 'Updated Message 1',
json: { updated: true }
});
};
updateInterval = function () {
cordova.plugins.notification.local.update({
id: 1,
text: 'Updated Message 1',
every: 'minute'
});
};
</script>
<!-- clear --> <!-- clear -->
<h2 class="section">Clear</h2> <script type="text/javascript">
<div class="container"> clearSingle = function () {
<div onclick="clearSingle()">Single<br /><span>clear(1)</span></div> cordova.plugins.notification.local.clear(1, callback);
<div onclick="clearMultiple()">Multiple<br /><span>clear(2, 3)</span></div> };
</div>
<div class="container"> clearMultiple = function () {
<div onclick="clearAll()">All<br /><span>clearAll()</span></div> cordova.plugins.notification.local.clear([2, 3], callback);
</div> };
clearAll = function () {
cordova.plugins.notification.local.clearAll(callback);
};
</script>
<!-- cancel --> <!-- cancel -->
<h2 class="section">Cancel</h2> <script type="text/javascript">
<div class="container"> cancel = function () {
<div onclick="cancel()">Single<br /><span>cancel(1)</span></div> cordova.plugins.notification.local.cancel(1, callback);
<div onclick="cancelMultiple()">Multiple<br /><span>cancel(2, 3)</span></div> };
</div>
<div class="container">
<div onclick="cancelAll()">All<br /><span>cancelAll()</span></div>
</div>
<!-- presence --> cancelMultiple = function () {
<h2 class="section">Presence</h2> cordova.plugins.notification.local.cancel([2, 3], callback);
<div class="container"> };
<div onclick="isScheduled()">Scheduled?<br /><span>isScheduled(1)</span></div>
<div onclick="isTriggered()">Triggered?<br /><span>isTrigered(1)</span></div>
</div>
<div class="container">
<div onclick="isPresent()">Present?<br /><span>present(1)</span></div>
</div>
<!-- id's --> cancelAll = function () {
<h2 class="section">ID's</h2> cordova.plugins.notification.local.cancelAll(callback);
<div class="container"> };
<div onclick="getScheduledIds()">Scheduled<br /><span>getScheduledIds()</span></div> </script>
<div onclick="getTriggeredIds()">Triggered<br /><span>getTriggeredIds()</span></div>
</div> <!-- presence -->
<div class="container"> <script type="text/javascript">
<div onclick="getIds()">All<br /><span>getIds()</span></div> isPresent = function () {
</div> cordova.plugins.notification.local.isPresent(id, function (present) {
showToast(present ? 'Yes' : 'No');
});
};
isScheduled = function () {
cordova.plugins.notification.local.isScheduled(id, function (scheduled) {
showToast(scheduled ? 'Yes' : 'No');
});
};
isTriggered = function () {
cordova.plugins.notification.local.isTriggered(id, function (triggered) {
showToast(triggered ? 'Yes' : 'No');
});
};
</script>
<!-- IDs -->
<script type="text/javascript">
var callbackIds = function (ids) {
showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
};
getIds = function () {
cordova.plugins.notification.local.getIds(callbackIds);
};
getScheduledIds = function () {
cordova.plugins.notification.local.getScheduledIds(callbackIds);
};
getTriggeredIds = function () {
cordova.plugins.notification.local.getTriggeredIds(callbackIds);
};
</script>
<!-- notifications --> <!-- notifications -->
<h2 class="section">Notifications</h2> <script type="text/javascript">
<div class="container"> var callbackOpts = function (notifications) {
<div onclick="getScheduled()">Scheduled<br /><span>getScheduled()</span></div> console.log(notifications);
<div onclick="getTriggered()">Triggered<br /><span>getTrigered()</span></div> showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
</div> };
<div class="container">
<div onclick="get()">Single<br /><span>get(1)</span></div>
<div onclick="getMultiple()">Multiple<br /><span>get(1, 2)</span></div>
</div>
<div class="container">
<div onclick="getAll()">All<br /><span>getAll()</span></div>
</div>
<!-- defaults --> get = function () {
<h2 class="section">Defaults</h2> cordova.plugins.notification.local.get(1, callbackOpts);
<div class="container"> };
<div onclick="setDefaultTitle()">Change title<br /><span>setDefaults(title:"...")</span></div>
</div>
<!-- copyright --> getMultiple = function () {
<div class="copyright"> cordova.plugins.notification.local.get([1, 2], callbackOpts);
© 2013-2015 appPlant };
</div>
</div> getAll = function () {
cordova.plugins.notification.local.getAll(callbackOpts);
<script type="text/javascript" src="cordova.js"></script> };
<script type="text/javascript" src="js/index.js"></script>
getScheduled = function () {
<script type="text/javascript"> cordova.plugins.notification.local.getScheduled(callbackOpts);
var id = 1, dialog; };
callback = function () { getTriggered = function () {
cordova.plugins.notification.local.getIds(function (ids) { cordova.plugins.notification.local.getTriggered(callbackOpts);
showToast('IDs: ' + ids.join(' ,')); };
}); </script>
};
<!-- defaults -->
showToast = function (text) { <script type="text/javascript">
setTimeout(function () { setDefaultTitle = function () {
if (device.platform != 'windows') { cordova.plugins.notification.local.setDefaults({
window.plugins.toast.showShortBottom(text); title: 'New Default Title'
} else { });
showDialog(text); };
} </script>
}, 100);
}; <!-- callbacks -->
<script type="text/javascript">
showDialog = function (text) { document.addEventListener('deviceready', function () {
if (dialog) {
dialog.content = text; cordova.plugins.notification.local.on('schedule', function (notification) {
return; console.log('onschedule', arguments);
} // showToast('scheduled: ' + notification.id);
});
dialog = new Windows.UI.Popups.MessageDialog(text);
cordova.plugins.notification.local.on('update', function (notification) {
dialog.showAsync().done(function () { console.log('onupdate', arguments);
dialog = null; // showToast('updated: ' + notification.id);
}); });
};
cordova.plugins.notification.local.on('trigger', function (notification) {
</script> console.log('ontrigger', arguments);
showToast('triggered: ' + notification.id);
<!-- permission --> });
<script type="text/javascript">
hasPermission = function () { cordova.plugins.notification.local.on('click', function (notification) {
cordova.plugins.notification.local.hasPermission(function (granted) { console.log('onclick', arguments);
showToast(granted ? 'Yes' : 'No'); showToast('clicked: ' + notification.id);
}); });
};
cordova.plugins.notification.local.on('cancel', function (notification) {
registerPermission = function () { console.log('oncancel', arguments);
cordova.plugins.notification.local.registerPermission(function (granted) { // showToast('canceled: ' + notification.id);
showToast(granted ? 'Yes' : 'No'); });
});
}; cordova.plugins.notification.local.on('clear', function (notification) {
</script> console.log('onclear', arguments);
showToast('cleared: ' + notification.id);
<!-- schedule --> });
<script type="text/javascript">
schedule = function () { cordova.plugins.notification.local.on('cancelall', function () {
cordova.plugins.notification.local.schedule({ console.log('oncancelall', arguments);
id: 1, // showToast('canceled all');
text: 'Test Message 1', });
icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png',
sound: null, cordova.plugins.notification.local.on('clearall', function () {
data: { test: id } console.log('onclearall', arguments);
}); // showToast('cleared all');
}; });
}, false);
scheduleMultiple = function () { </script>
cordova.plugins.notification.local.schedule([{
id: 1, <!-- initialize -->
text: 'Multi Message 1' <script type="text/javascript">
}, { app.initialize();
id: 2, </script>
text: 'Multi Message 2' </body>
}, {
id: 3,
text: 'Multi Message 3'
}]);
};
scheduleDelayed = function () {
var now = new Date().getTime(),
_5_sec_from_now = new Date(now + 5 * 1000);
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({
id: 1,
title: 'Scheduled with delay',
text: 'Test Message 1',
at: _5_sec_from_now,
sound: sound
});
};
scheduleMinutely = function () {
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({
id: 1,
text: 'Scheduled every minute',
every: 'minute',
sound: sound
});
};
</script>
<!-- update -->
<script type="text/javascript">
update = function () {
cordova.plugins.notification.local.update({
id: 1,
text: 'Updated Message 1',
json: { updated: true }
});
};
updateInterval = function () {
cordova.plugins.notification.local.update({
id: 1,
text: 'Updated Message 1',
every: 'minute'
});
};
</script>
<!-- clear -->
<script type="text/javascript">
clearSingle = function () {
cordova.plugins.notification.local.clear(1, callback);
};
clearMultiple = function () {
cordova.plugins.notification.local.clear([2, 3], callback);
};
clearAll = function () {
cordova.plugins.notification.local.clearAll(callback);
};
</script>
<!-- cancel -->
<script type="text/javascript">
cancel = function () {
cordova.plugins.notification.local.cancel(1, callback);
};
cancelMultiple = function () {
cordova.plugins.notification.local.cancel([2, 3], callback);
};
cancelAll = function () {
cordova.plugins.notification.local.cancelAll(callback);
};
</script>
<!-- presence -->
<script type="text/javascript">
isPresent = function () {
cordova.plugins.notification.local.isPresent(id, function (present) {
showToast(present ? 'Yes' : 'No');
});
};
isScheduled = function () {
cordova.plugins.notification.local.isScheduled(id, function (scheduled) {
showToast(scheduled ? 'Yes' : 'No');
});
};
isTriggered = function () {
cordova.plugins.notification.local.isTriggered(id, function (triggered) {
showToast(triggered ? 'Yes' : 'No');
});
};
</script>
<!-- IDs -->
<script type="text/javascript">
var callbackIds = function (ids) {
showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
};
getIds = function () {
cordova.plugins.notification.local.getIds(callbackIds);
};
getScheduledIds = function () {
cordova.plugins.notification.local.getScheduledIds(callbackIds);
};
getTriggeredIds = function () {
cordova.plugins.notification.local.getTriggeredIds(callbackIds);
};
</script>
<!-- notifications -->
<script type="text/javascript">
var callbackOpts = function (notifications) {
console.log(notifications);
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
};
get = function () {
cordova.plugins.notification.local.get(1, callbackOpts);
};
getMultiple = function () {
cordova.plugins.notification.local.get([1, 2], callbackOpts);
};
getAll = function () {
cordova.plugins.notification.local.getAll(callbackOpts);
};
getScheduled = function () {
cordova.plugins.notification.local.getScheduled(callbackOpts);
};
getTriggered = function () {
cordova.plugins.notification.local.getTriggered(callbackOpts);
};
</script>
<!-- defaults -->
<script type="text/javascript">
setDefaultTitle = function () {
cordova.plugins.notification.local.setDefaults({
title: 'New Default Title'
});
};
</script>
<!-- callbacks -->
<script type="text/javascript">
document.addEventListener('deviceready', function () {
cordova.plugins.notification.local.on('schedule', function (notification) {
console.log('onschedule', arguments);
// showToast('scheduled: ' + notification.id);
});
cordova.plugins.notification.local.on('update', function (notification) {
console.log('onupdate', arguments);
// showToast('updated: ' + notification.id);
});
cordova.plugins.notification.local.on('trigger', function (notification) {
console.log('ontrigger', arguments);
showToast('triggered: ' + notification.id);
});
cordova.plugins.notification.local.on('click', function (notification) {
console.log('onclick', arguments);
showToast('clicked: ' + notification.id);
});
cordova.plugins.notification.local.on('cancel', function (notification) {
console.log('oncancel', arguments);
// showToast('canceled: ' + notification.id);
});
cordova.plugins.notification.local.on('clear', function (notification) {
console.log('onclear', arguments);
showToast('cleared: ' + notification.id);
});
cordova.plugins.notification.local.on('cancelall', function () {
console.log('oncancelall', arguments);
// showToast('canceled all');
});
cordova.plugins.notification.local.on('clearall', function () {
console.log('onclearall', arguments);
// showToast('cleared all');
});
}, false);
</script>
<!-- initialize -->
<script type="text/javascript">
app.initialize();
</script>
</body>
</html> </html>
...@@ -42,86 +42,86 @@ ...@@ -42,86 +42,86 @@
<!-- permission --> <!-- permission -->
<h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2> <h2 class="section" style="padding-top:180px;">Permission (iOS8)</h2>
<div class="container"> <div class="container">
<div onclick="hasPermission()">Granted?<br/><span>hasPermission()</span></div> <div onclick="hasPermission()">Granted?<br /><span>hasPermission()</span></div>
<div onclick="registerPermission()">Register<br/><span>registerPermission()</span></div> <div onclick="registerPermission()">Register<br /><span>registerPermission()</span></div>
</div> </div>
<!-- schedule --> <!-- schedule -->
<h2 class="section">Schedule</h2> <h2 class="section">Schedule</h2>
<div class="container"> <div class="container">
<div onclick="schedule()">Single<br/><span>schedule(1)</span></div> <div onclick="schedule()">Single<br /><span>schedule(1)</span></div>
<div onclick="scheduleMultiple()">Multiple<br/><span>schedule(1, 2, 3)</span></div> <div onclick="scheduleMultiple()">Multiple<br /><span>schedule(1, 2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="scheduleDelayed()">In 5 sec<br/><span>schedule(1, firstAt:later)</span></div> <div onclick="scheduleDelayed()">In 5 sec<br /><span>schedule(1, firstAt:later)</span></div>
<div onclick="scheduleMinutely()">Every min<br/><span>schedule(1, every:minute)</span></div> <div onclick="scheduleMinutely()">Every min<br /><span>schedule(1, every:minute)</span></div>
</div> </div>
<!-- update --> <!-- update -->
<h2 class="section">Update</h2> <h2 class="section">Update</h2>
<div class="container"> <div class="container">
<div onclick="update()">Title<br/><span>update(1)</span></div> <div onclick="update()">Title<br /><span>update(1)</span></div>
<div onclick="updateInterval()">Interval<br/><span>update(1, every:minute)</span></div> <div onclick="updateInterval()">Interval<br /><span>update(1, every:minute)</span></div>
</div> </div>
<!-- clear --> <!-- clear -->
<h2 class="section">Clear</h2> <h2 class="section">Clear</h2>
<div class="container"> <div class="container">
<div onclick="clearSingle()">Single<br/><span>clear(1)</span></div> <div onclick="clearSingle()">Single<br /><span>clear(1)</span></div>
<div onclick="clearMultiple()">Multiple<br/><span>clear(2, 3)</span></div> <div onclick="clearMultiple()">Multiple<br /><span>clear(2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="clearAll()">All<br/><span>clearAll()</span></div> <div onclick="clearAll()">All<br /><span>clearAll()</span></div>
</div> </div>
<!-- cancel --> <!-- cancel -->
<h2 class="section">Cancel</h2> <h2 class="section">Cancel</h2>
<div class="container"> <div class="container">
<div onclick="cancel()">Single<br/><span>cancel(1)</span></div> <div onclick="cancel()">Single<br /><span>cancel(1)</span></div>
<div onclick="cancelMultiple()">Multiple<br/><span>cancel(2, 3)</span></div> <div onclick="cancelMultiple()">Multiple<br /><span>cancel(2, 3)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="cancelAll()">All<br/><span>cancelAll()</span></div> <div onclick="cancelAll()">All<br /><span>cancelAll()</span></div>
</div> </div>
<!-- presence --> <!-- presence -->
<h2 class="section">Presence</h2> <h2 class="section">Presence</h2>
<div class="container"> <div class="container">
<div onclick="isScheduled()">Scheduled?<br/><span>isScheduled(1)</span></div> <div onclick="isScheduled()">Scheduled?<br /><span>isScheduled(1)</span></div>
<div onclick="isTriggered()">Triggered?<br/><span>isTrigered(1)</span></div> <div onclick="isTriggered()">Triggered?<br /><span>isTrigered(1)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="isPresent()">Present?<br/><span>present(1)</span></div> <div onclick="isPresent()">Present?<br /><span>present(1)</span></div>
</div> </div>
<!-- id's --> <!-- id's -->
<h2 class="section">ID's</h2> <h2 class="section">ID's</h2>
<div class="container"> <div class="container">
<div onclick="getScheduledIds()">Scheduled<br/><span>getScheduledIds()</span></div> <div onclick="getScheduledIds()">Scheduled<br /><span>getScheduledIds()</span></div>
<div onclick="getTriggeredIds()">Triggered<br/><span>getTriggeredIds()</span></div> <div onclick="getTriggeredIds()">Triggered<br /><span>getTriggeredIds()</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="getIds()">All<br/><span>getIds()</span></div> <div onclick="getIds()">All<br /><span>getIds()</span></div>
</div> </div>
<!-- notifications --> <!-- notifications -->
<h2 class="section">Notifications</h2> <h2 class="section">Notifications</h2>
<div class="container"> <div class="container">
<div onclick="getScheduled()">Scheduled<br/><span>getScheduled()</span></div> <div onclick="getScheduled()">Scheduled<br /><span>getScheduled()</span></div>
<div onclick="getTriggered()">Triggered<br/><span>getTrigered()</span></div> <div onclick="getTriggered()">Triggered<br /><span>getTrigered()</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="get()">Single<br/><span>get(1)</span></div> <div onclick="get()">Single<br /><span>get(1)</span></div>
<div onclick="getMultiple()">Multiple<br/><span>get(1, 2)</span></div> <div onclick="getMultiple()">Multiple<br /><span>get(1, 2)</span></div>
</div> </div>
<div class="container"> <div class="container">
<div onclick="getAll()">All<br/><span>getAll()</span></div> <div onclick="getAll()">All<br /><span>getAll()</span></div>
</div> </div>
<!-- defaults --> <!-- defaults -->
<h2 class="section">Defaults</h2> <h2 class="section">Defaults</h2>
<div class="container"> <div class="container">
<div onclick="setDefaultTitle()">Change title<br/><span>setDefaults(title:"...")</span></div> <div onclick="setDefaultTitle()">Change title<br /><span>setDefaults(title:"...")</span></div>
</div> </div>
<!-- copyright --> <!-- copyright -->
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
}); });
}; };
</script> </script>
<!-- permission --> <!-- permission -->
<script type="text/javascript"> <script type="text/javascript">
...@@ -186,38 +186,38 @@ ...@@ -186,38 +186,38 @@
<script type="text/javascript"> <script type="text/javascript">
schedule = function () { schedule = function () {
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
text: 'Test Message 1', text: 'Test Message 1',
icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png', icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png',
sound: null, sound: null,
data: { test:id } data: { test: id }
}); });
}; };
scheduleMultiple = function () { scheduleMultiple = function () {
cordova.plugins.notification.local.schedule([{ cordova.plugins.notification.local.schedule([{
id: 1, id: 1,
text: 'Multi Message 1' text: 'Multi Message 1'
},{ }, {
id: 2, id: 2,
text: 'Multi Message 2' text: 'Multi Message 2'
},{ }, {
id: 3, id: 3,
text: 'Multi Message 3' text: 'Multi Message 3'
}]); }]);
}; };
scheduleDelayed = function () { scheduleDelayed = function () {
var now = new Date().getTime(), var now = new Date().getTime(),
_5_sec_from_now = new Date(now + 5*1000); _5_sec_from_now = new Date(now + 5 * 1000);
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf'; var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
title: 'Scheduled with delay', title: 'Scheduled with delay',
text: 'Test Message 1', text: 'Test Message 1',
at: _5_sec_from_now, at: _5_sec_from_now,
sound: sound sound: sound
}); });
}; };
...@@ -226,8 +226,8 @@ ...@@ -226,8 +226,8 @@
var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf'; var sound = device.platform == 'Android' ? 'file://sound.mp3' : 'file://beep.caf';
cordova.plugins.notification.local.schedule({ cordova.plugins.notification.local.schedule({
id: 1, id: 1,
text: 'Scheduled every minute', text: 'Scheduled every minute',
every: 'minute', every: 'minute',
sound: sound sound: sound
}); });
...@@ -238,16 +238,16 @@ ...@@ -238,16 +238,16 @@
<script type="text/javascript"> <script type="text/javascript">
update = function () { update = function () {
cordova.plugins.notification.local.update({ cordova.plugins.notification.local.update({
id: 1, id: 1,
text: 'Updated Message 1', text: 'Updated Message 1',
json: { updated:true } json: { updated: true }
}); });
}; };
updateInterval = function () { updateInterval = function () {
cordova.plugins.notification.local.update({ cordova.plugins.notification.local.update({
id: 1, id: 1,
text: 'Updated Message 1', text: 'Updated Message 1',
every: 'minute' every: 'minute'
}); });
}; };
...@@ -256,11 +256,11 @@ ...@@ -256,11 +256,11 @@
<!-- clear --> <!-- clear -->
<script type="text/javascript"> <script type="text/javascript">
clearSingle = function () { clearSingle = function () {
cordova.plugins.notification.local.clear(1,callback); cordova.plugins.notification.local.clear(1, callback);
}; };
clearMultiple = function () { clearMultiple = function () {
cordova.plugins.notification.local.clear([2, 3],callback); cordova.plugins.notification.local.clear([2, 3], callback);
}; };
clearAll = function () { clearAll = function () {
...@@ -271,11 +271,11 @@ ...@@ -271,11 +271,11 @@
<!-- cancel --> <!-- cancel -->
<script type="text/javascript"> <script type="text/javascript">
cancel = function () { cancel = function () {
cordova.plugins.notification.local.cancel(1,callback); cordova.plugins.notification.local.cancel(1, callback);
}; };
cancelMultiple = function () { cancelMultiple = function () {
cordova.plugins.notification.local.cancel([2, 3],callback); cordova.plugins.notification.local.cancel([2, 3], callback);
}; };
cancelAll = function () { cancelAll = function () {
...@@ -307,8 +307,8 @@ ...@@ -307,8 +307,8 @@
<!-- IDs --> <!-- IDs -->
<script type="text/javascript"> <script type="text/javascript">
var callbackIds = function (ids) { var callbackIds = function (ids) {
showToast(ids.length === 0 ? '- none -' : ids.join(' ,')); showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
}; };
getIds = function () { getIds = function () {
cordova.plugins.notification.local.getIds(callbackIds); cordova.plugins.notification.local.getIds(callbackIds);
...@@ -326,9 +326,9 @@ ...@@ -326,9 +326,9 @@
<!-- notifications --> <!-- notifications -->
<script type="text/javascript"> <script type="text/javascript">
var callbackOpts = function (notifications) { var callbackOpts = function (notifications) {
console.log(notifications); console.log(notifications);
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,')); showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
}; };
get = function () { get = function () {
cordova.plugins.notification.local.get(1, callbackOpts); cordova.plugins.notification.local.get(1, callbackOpts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment