Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixup ical/vcal options

  • Loading branch information...
commit 3a0928cd024febf3ee0a001415819e394aaa133a 1 parent da86de7
Paul Gallagher authored
Showing with 22 additions and 13 deletions.
  1. +10 −4 addtocal.htm
  2. +12 −9 jquery.addtocal.js
14 addtocal.htm
View
@@ -45,16 +45,22 @@
$(document).ready(function() {
$('.addtocal').addtocal({
- webcalProvided:false,
+ icalEnabled:false,
+ vcalEnabled:false,
getEventDetails: function( element ) {
var start = new Date();
var end = new Date();
end.setTime(end.getTime() + 60 * 60 * 1000);
return {
- webcalurl: 'webcal://',
+ webcalurl: null,
+ icalurl: null,
+ vcalurl: null,
start: start, end: end,
- title: element.attr('id'), details: element.html(),
- location: null, url: null};
+ title: element.attr('id'),
+ details: element.html(),
+ location: null,
+ url: null
+ };
},
});
21 jquery.addtocal.js
View
@@ -21,10 +21,13 @@
collision: "none"
},
selectedCalendarTarget: null,
- webcalProvided: true,
+ icalEnabled: true,
+ vcalEnabled: true,
getEventDetails: function( element ) {
return {
- webcalurl: 'webcal://',
+ webcalurl: 'webcal://site.ics',
+ icalurl: 'http://site.ics',
+ vcalurl: 'http://site.vcs',
start: new Date(), end: new Date(),
title: null, details: null,
location: null, url: null};
@@ -73,11 +76,14 @@
"http://30boxes.com/add.php?webcal=" + encodeURIComponent( eventDetails.webcalurl ) : null );
break;
case 5:// iCal
- link=( eventDetails.webcalurl ? eventDetails.webcalurl : null );
+ link=( eventDetails.icalurl ? eventDetails.icalurl : null );
+ break;
+ case 6:// vCal
+ link=( eventDetails.vcalurl ? eventDetails.vcalurl : null );
break;
default:
}
- if(link) window.open(link, '_blank');
+ if(link) window.open(link);
},
},
_create: function() {
@@ -140,7 +146,8 @@
{value: 1, label:"Add to Google Calendar"},
{value: 2, label:"Add to Live Calendar"},
{value: 3, label:"Add to Yahoo! Calendar"} ]
- if(this.options.webcalProvided) this.source.push( {value: 4, label:"Add to 30boxes"}, {value: 5, label:"iCal" } );
+ if(this.options.icalEnabled) this.source.push( {value: 4, label:"Add to 30boxes"}, {value: 5, label:"iCal" } );
+ if(this.options.vcalEnabled) this.source.push( {value: 6, label:"vCalendar"} );
},
toggleMenu: function( event ) {
@@ -154,10 +161,6 @@
this.close();
}
},
-
- xxx: function( element ) {
- return 'xyz';
- },
close: function( event ) {
clearTimeout( this.closing );
Please sign in to comment.
Something went wrong with that request. Please try again.