Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixup ical/vcal options

  • Loading branch information...
commit 3a0928cd024febf3ee0a001415819e394aaa133a 1 parent da86de7
Paul Gallagher authored

Showing 2 changed files with 22 additions and 13 deletions. Show diff stats Hide diff stats

  1. +10 4 addtocal.htm
  2. +12 9 jquery.addtocal.js
14 addtocal.htm
@@ -45,16 +45,22 @@
45 45 $(document).ready(function() {
46 46
47 47 $('.addtocal').addtocal({
48   - webcalProvided:false,
  48 + icalEnabled:false,
  49 + vcalEnabled:false,
49 50 getEventDetails: function( element ) {
50 51 var start = new Date();
51 52 var end = new Date();
52 53 end.setTime(end.getTime() + 60 * 60 * 1000);
53 54 return {
54   - webcalurl: 'webcal://',
  55 + webcalurl: null,
  56 + icalurl: null,
  57 + vcalurl: null,
55 58 start: start, end: end,
56   - title: element.attr('id'), details: element.html(),
57   - location: null, url: null};
  59 + title: element.attr('id'),
  60 + details: element.html(),
  61 + location: null,
  62 + url: null
  63 + };
58 64 },
59 65 });
60 66
21 jquery.addtocal.js
@@ -21,10 +21,13 @@
21 21 collision: "none"
22 22 },
23 23 selectedCalendarTarget: null,
24   - webcalProvided: true,
  24 + icalEnabled: true,
  25 + vcalEnabled: true,
25 26 getEventDetails: function( element ) {
26 27 return {
27   - webcalurl: 'webcal://',
  28 + webcalurl: 'webcal://site.ics',
  29 + icalurl: 'http://site.ics',
  30 + vcalurl: 'http://site.vcs',
28 31 start: new Date(), end: new Date(),
29 32 title: null, details: null,
30 33 location: null, url: null};
@@ -73,11 +76,14 @@
73 76 "http://30boxes.com/add.php?webcal=" + encodeURIComponent( eventDetails.webcalurl ) : null );
74 77 break;
75 78 case 5:// iCal
76   - link=( eventDetails.webcalurl ? eventDetails.webcalurl : null );
  79 + link=( eventDetails.icalurl ? eventDetails.icalurl : null );
  80 + break;
  81 + case 6:// vCal
  82 + link=( eventDetails.vcalurl ? eventDetails.vcalurl : null );
77 83 break;
78 84 default:
79 85 }
80   - if(link) window.open(link, '_blank');
  86 + if(link) window.open(link);
81 87 },
82 88 },
83 89 _create: function() {
@@ -140,7 +146,8 @@
140 146 {value: 1, label:"Add to Google Calendar"},
141 147 {value: 2, label:"Add to Live Calendar"},
142 148 {value: 3, label:"Add to Yahoo! Calendar"} ]
143   - if(this.options.webcalProvided) this.source.push( {value: 4, label:"Add to 30boxes"}, {value: 5, label:"iCal" } );
  149 + if(this.options.icalEnabled) this.source.push( {value: 4, label:"Add to 30boxes"}, {value: 5, label:"iCal" } );
  150 + if(this.options.vcalEnabled) this.source.push( {value: 6, label:"vCalendar"} );
144 151 },
145 152
146 153 toggleMenu: function( event ) {
@@ -154,10 +161,6 @@
154 161 this.close();
155 162 }
156 163 },
157   -
158   - xxx: function( element ) {
159   - return 'xyz';
160   - },
161 164
162 165 close: function( event ) {
163 166 clearTimeout( this.closing );

0 comments on commit 3a0928c

Please sign in to comment.
Something went wrong with that request. Please try again.