Skip to content

Commit

Permalink
fixup ical/vcal options
Browse files Browse the repository at this point in the history
  • Loading branch information
tardate committed Jul 29, 2010
1 parent da86de7 commit 3a0928c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
14 changes: 10 additions & 4 deletions addtocal.htm
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
},
});

Expand Down
21 changes: 12 additions & 9 deletions jquery.addtocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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 ) {
Expand All @@ -154,10 +161,6 @@
this.close();
}
},

xxx: function( element ) {
return 'xyz';
},

close: function( event ) {
clearTimeout( this.closing );
Expand Down

0 comments on commit 3a0928c

Please sign in to comment.