- From: Richard Tibbett via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 11 Jan 2011 15:11:09 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/calendar In directory hutz:/tmp/cvs-serv9716/calendar Modified Files: Overview.html Log Message: Added save and update examples to section 'Adding and Updating Calendar Events'. Index: Overview.html =================================================================== RCS file: /sources/public/2009/dap/calendar/Overview.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Overview.html 11 Jan 2011 15:04:59 -0000 1.14 +++ Overview.html 11 Jan 2011 15:11:07 -0000 1.15 @@ -1289,7 +1289,19 @@ <pre class="sh_javascript"><a id="ical">Save our Event in your Calendar</a> <script type="text/javascript"> - // include example here + // obtain an ArrayBuffer consisting of valid iCalendar syntax (out of scope) + var iCalObj = getICalendar( /* ... */ ); + + // create a new iCalendar Blob [[FILE-WRITER]] + var calendarEventBlobBuilder = new BlobBuilder(); + calendarEventBlobBuilder.append( iCalObj ); + var calendarEventBlob = calendarEventBlobBuilder.getBlob( "text/calendar" ); + + // obtain an iCalendar Blob URL [[FILE-API]] + var calendarEventBlobURL = window.URL.createObjectUrl( calendarEventBlob ); + + // assign iCalendar Blob URL to an anchor element for presentation and download by the user + document.getElementById('ical').href = calendarEventBlobURL; </script> </pre> </div> @@ -1320,7 +1332,27 @@ <pre class="sh_javascript"><a id="vcard">Update our Event in your Calendar</a> <script type="text/javascript"> - // include example here + // Obtain a single existing Calendar Event object resulting from navigator.service.calendar.find() + var existingCalendarEventObj = ...; + + // Modify some parameters as required. e.g. add a new phone number + existingCalendarEventObj.location = 'Conf call number change: #XXX'; + + // With the existing Calendar Event object, create an ArrayBuffer consisting of valid iCalendar + // syntax (out of scope) making sure to set the resulting iCalendar UID property to + // the id parameter returned in the existing Calendar Event object + var iCalObj = getICalendar( existingCalendarEventObj ); + + // create a new iCalendar Blob [[FILE-WRITER]] + var calendarEventBlobBuilder = new BlobBuilder(); + calendarEventBlobBuilder.append( iCalObj ); + var calendarEventBlob = calendarEventBlobBuilder.getBlob( "text/calendar" ); + + // obtain an iCalendar Blob URL [[FILE-API]] + var calendarEventBlobURL = window.URL.createObjectUrl( calendarEventBlob ); + + // assign iCalendar Blob URL to an anchor element for presentation and download by the user + document.getElementById('ical').href = calendarEventBlobURL; </script> </pre> </div>
Received on Tuesday, 11 January 2011 15:11:10 UTC