-
Notifications
You must be signed in to change notification settings - Fork 15
/
calendar.js
56 lines (45 loc) · 1.81 KB
/
calendar.js
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
function calendarPlugin()
{
}
calendarPlugin.prototype.createEvent = function(title,location,notes,startDate,endDate, successCallback, errorCallback) {
if (typeof errorCallback != "function") {
console.log("calendarPlugin.createEvent failure: errorCallback parameter must be a function");
return
}
if (typeof successCallback != "function") {
console.log("calendarPlugin.createEvent failure: successCallback parameter must be a function");
return
}
cordova.exec(
successCallback, // called when signature capture is successful
errorCallback, // called when signature capture encounters an error
'CalendarPlugin', // Tell cordova that we want to run "PushNotificationPlugin"
'addToCalendar', // Tell the plugin the action we want to perform
[{
"title": title,
"description": notes,
"eventLocation": location,
"startTimeMillis": startDate.getTime(),
"endTimeMillis": endDate.getTime()
}]
); // List of arguments to the plugin
};
calendarPlugin.prototype.deleteEvent = function(title,location,notes,startDate,endDate, deleteAll, successCallback, errorCallback) {
throw "NotImplemented";
}
calendarPlugin.prototype.findEvent = function(title,location,notes,startDate,endDate, successCallback, errorCallback) {
throw "NotImplemented";
}
calendarPlugin.prototype.modifyEvent = function(title,location,notes,startDate,endDate, newTitle, newLocation, newNotes, newStartDate, newEndDate, successCallback, errorCallback) {
throw "NotImplemented";
}
calendarPlugin.install = function()
{
if(!window.plugins)
{
window.plugins = {};
}
window.plugins.calendarPlugin = new calendarPlugin();
return window.plugins.calendarPlugin;
};
cordova.addConstructor(calendarPlugin.install);