Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 104 lines (78 sloc) 4.211 kb
45532bd6 »
2010-10-03 standardise on AddToCal project name to avoid ambiguity
1 = jQuery UI AddToCal widget v0.1.0
0effb2a6 »
2010-10-03 add license and documentation
2
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
3 AddToCal is a jQuery UI widget that provides "Add to Calendar" functionality for any website.
0effb2a6 »
2010-10-03 add license and documentation
4 Given event details, it allows users to add the event to any supported calendar system.
5
6 Supported calendar systems:
7 * Google Calendar
8 * Microsoft Live Calendar
9 * Yahoo! Calendar
10 * 30boxes
11 * Any iCal-compatible desktop application
12 * Any vCalendar-compatible desktop application
13
c1432552 »
2010-10-03 update documentation
14 See the {addtocal.htm}[http://github.com/tardate/jquery.addtocalendar/blob/master//addtocal.htm] demo file for
f4f51023 »
2010-10-03 add link to live demo
15 an example of how to initialize and use the widget. You can find and use a live demo at http://tardate.com/addtocal/addtocal.htm
0effb2a6 »
2010-10-03 add license and documentation
16
45532bd6 »
2010-10-03 standardise on AddToCal project name to avoid ambiguity
17 Using AddToCal is simply a matter of initializing the widget, and attaching it to any DOM element that will
0effb2a6 »
2010-10-03 add license and documentation
18 hold a calendarable event in your application.
19
45532bd6 »
2010-10-03 standardise on AddToCal project name to avoid ambiguity
20 You need to implement one method when initializing AddToCal: getEventDetails( element ).
c1432552 »
2010-10-03 update documentation
21 It is called when a user selects a calendar to add an event to.
22 The element parameter is the jQuery object for the event invoked.
0effb2a6 »
2010-10-03 add license and documentation
23 You must return an object packed with the relevant event details.
c1432552 »
2010-10-03 update documentation
24 How you determine the event attributes will depend on your page structure, and whether you are using a standard markup such as
0effb2a6 »
2010-10-03 add license and documentation
25 the {hCalendar microformat}[http://microformats.org/wiki/hcalendar].
26
c1432552 »
2010-10-03 update documentation
27 === Widget Initialzation
28 Here's an example of the minimal initialisation require. This example attaches the addtocal widget to all elements with the class 'addtocal'.
29
e22f9364 »
2010-10-03 add js includes to example
30 <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
31 <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js'></script>
32
33 <script type='text/javascript' src='javascripts/rfc3339date.js'></script>
34 <script type='text/javascript' src='javascripts/jquery.addtocal.js'></script>
35
36 <script type='text/javascript'>
c1432552 »
2010-10-03 update documentation
37 $(document).ready(function() {
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
38
c1432552 »
2010-10-03 update documentation
39 $('.addtocal').AddToCal({
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
40 // ical and vcal require an ics or vcs file to be served.
c1432552 »
2010-10-03 update documentation
41 // Disable these features if reqired (as a result the 30boxes, iCal and vCalendar menu links will not appear)
42 icalEnabled:false,
43 vcalEnabled:false,
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
44
c1432552 »
2010-10-03 update documentation
45 getEventDetails: function( element ) {
46
47 ... [implement whatever is required to parse 'element' into the required event structure] ...
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
48
c1432552 »
2010-10-03 update documentation
49 // return the required event structure
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
50 return {
c1432552 »
2010-10-03 update documentation
51 webcalurl: null,
52 icalurl: null,
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
53 vcalurl: null,
54 start: start,
55 end: end,
56 title: title,
57 details: details,
58 location: null,
c1432552 »
2010-10-03 update documentation
59 url: null
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
60 };
61 }
c1432552 »
2010-10-03 update documentation
62 });
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
63
c1432552 »
2010-10-03 update documentation
64 });
e22f9364 »
2010-10-03 add js includes to example
65 </script>
c1432552 »
2010-10-03 update documentation
66
67 === Required getEventDetails event structure
68
69 The structure returned from getEventDetails has the following members:
70 * webcalurl: full url to webcal resource (if supported) e.g. webcal://mydomain/events/1.ics
71 * icalurl: full url to iCal resource (if supported) e.g. http://mydomain/events/1.ics
72 * vcalurl: full url to vCalendar resource (if supported) e.g. http://mydomain/events/1.vcs
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
73 * start: start time of the event (javascript date object)
74 * end: end time of the event (javascript date object)
75 * title: event title text
76 * details: event details text
77 * location: event location text
c1432552 »
2010-10-03 update documentation
78 * url: full url to information about the event e.g. http://mydomain/events/1.html
4bd80b83 »
2013-01-08 \#9 fix README luring us into an IE compatibility trap
79
80
c1432552 »
2010-10-03 update documentation
81
0effb2a6 »
2010-10-03 add license and documentation
82 == Source
83 For more information and source files, see the project's {github repository}[http://github.com/tardate/jquery.addtocalendar].
84 Feel free to fork and enhance!
85
86 == Dependencies
87
88 * {jQuery 1.4.x}[http://jquery.com/]
89 * {jQuery UI 1.8.x}[http://jqueryui.com/]
90 * {rfc3339date.js}[http://github.com/tardate/rfc3339date.js]
7ef6401d »
2010-08-11 basic functionality
91
92 == Copyright
0effb2a6 »
2010-10-03 add license and documentation
93 Copyright (c) 2010 Paul GALLAGHER http://tardate.com
7ef6401d »
2010-08-11 basic functionality
94
0effb2a6 »
2010-10-03 add license and documentation
95 Dual licensed under the {MIT}[http://www.opensource.org/licenses/mit-license.php] or
96 {GPL Version 2}[http://www.gnu.org/licenses/gpl.html] licenses.
7ef6401d »
2010-08-11 basic functionality
97
98 == Other References
99
0effb2a6 »
2010-10-03 add license and documentation
100 * {Google Calendar}[http://www.google.com/googlecalendar/event_publisher_guide.html]
101 * {Windows Live Calendar}[http://mailcall.spaces.live.com/blog/cns!CC9301187A51FE33!49778.entry]
102 * {Yahoo!, Google, iCal}[http://davelms.co.uk/2006/09/04/add-to-calendar/]
103 * {hCalendar microformat}[http://microformats.org/wiki/hcalendar]
Something went wrong with that request. Please try again.