| 1 |
- (function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){module.exports=e(require("jquery"))}else{e(jQuery)}})(function(u){var f="https://www.googleapis.com/calendar/v3/calendars";var g=u.fullCalendar;var p=g.applyAll;g.sourceNormalizers.push(function(e){var a=e.googleCalendarId;var r=e.url;var o;if(!a&&r){if(/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(r)){a=r}else if((o=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(r))||(o=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(r))){a=decodeURIComponent(o[1])}if(a){e.googleCalendarId=a}}if(a){if(e.editable==null){e.editable=false}e.url=a}});g.sourceFetchers.push(function(e,a,r,o){if(e.googleCalendarId){return l(e,a,r,o,this)}});function l(o,e,a,r,l){var n=f+"/"+encodeURIComponent(o.googleCalendarId)+"/events?callback=?";var t=o.googleCalendarApiKey||l.options.googleCalendarApiKey;var i=o.success;var s;var d;function c(e,a){var r=a||[{message:e}];(o.googleCalendarError||u.noop).apply(l,r);(l.options.googleCalendarError||u.noop).apply(l,r);g.warn.apply(null,[e].concat(a||[]))}if(!t){c("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/");return{}}if(!e.hasZone()){e=e.clone().utc().add(-1,"day")}if(!a.hasZone()){a=a.clone().utc().add(1,"day")}if(r&&r!="local"){d=r.replace(" ","_")}s=u.extend({},o.data||{},{key:t,timeMin:e.format(),timeMax:a.format(),timeZone:d,singleEvents:true,maxResults:9999});return u.extend({},o,{googleCalendarId:null,url:n,data:s,startParam:false,endParam:false,timezoneParam:false,success:function(e){var o=[];var a;var r;if(e.error){c("Google Calendar API: "+e.error.message,e.error.errors)}else if(e.items){u.each(e.items,function(e,a){var r=a.htmlLink;if(d){r=m(r,"ctz="+d)}o.push({id:a.id,title:a.summary,start:a.start.dateTime||a.start.date,end:a.end.dateTime||a.end.date,url:r,location:a.location,description:a.description})});a=[o].concat(Array.prototype.slice.call(arguments,1));r=p(i,this,a);if(u.isArray(r)){return r}}return o}})}function m(e,o){return e.replace(/(\?.*?)?(#|$)/,function(e,a,r){return(a?a+"&":"?")+o+r})}});
|