|
|
@@ -1,9 +1,9 @@ |
|
|
|
/*! |
|
|
|
* FullCalendar v2.3.2 Google Calendar Plugin |
|
|
|
* FullCalendar v2.8.0 Google Calendar Plugin |
|
|
|
* Docs & License: http://fullcalendar.io/ |
|
|
|
* (c) 2015 Adam Shaw |
|
|
|
* (c) 2016 Adam Shaw |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
(function(factory) { |
|
|
|
if (typeof define === 'function' && define.amd) { |
|
|
|
define([ 'jquery' ], factory); |
|
|
@@ -18,11 +18,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
var API_BASE = 'https://www.googleapis.com/calendar/v3/calendars'; |
|
|
|
var fc = $.fullCalendar; |
|
|
|
var applyAll = fc.applyAll; |
|
|
|
var FC = $.fullCalendar; |
|
|
|
var applyAll = FC.applyAll; |
|
|
|
|
|
|
|
|
|
|
|
fc.sourceNormalizers.push(function(sourceOptions) { |
|
|
|
FC.sourceNormalizers.push(function(sourceOptions) { |
|
|
|
var googleCalendarId = sourceOptions.googleCalendarId; |
|
|
|
var url = sourceOptions.url; |
|
|
|
var match; |
|
|
@@ -64,7 +64,7 @@ fc.sourceNormalizers.push(function(sourceOptions) { |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
fc.sourceFetchers.push(function(sourceOptions, start, end, timezone) { |
|
|
|
FC.sourceFetchers.push(function(sourceOptions, start, end, timezone) { |
|
|
|
if (sourceOptions.googleCalendarId) { |
|
|
|
return transformOptions(sourceOptions, start, end, timezone, this); // `this` is the calendar |
|
|
|
} |
|
|
@@ -80,17 +80,13 @@ function transformOptions(sourceOptions, start, end, timezone, calendar) { |
|
|
|
|
|
|
|
function reportError(message, apiErrorObjs) { |
|
|
|
var errorObjs = apiErrorObjs || [ { message: message } ]; // to be passed into error handlers |
|
|
|
var consoleObj = window.console; |
|
|
|
var consoleWarnFunc = consoleObj ? (consoleObj.warn || consoleObj.log) : null; |
|
|
|
|
|
|
|
// call error handlers |
|
|
|
(sourceOptions.googleCalendarError || $.noop).apply(calendar, errorObjs); |
|
|
|
(calendar.options.googleCalendarError || $.noop).apply(calendar, errorObjs); |
|
|
|
|
|
|
|
// print error to debug console |
|
|
|
if (consoleWarnFunc) { |
|
|
|
consoleWarnFunc.apply(consoleObj, [ message ].concat(apiErrorObjs || [])); |
|
|
|
} |
|
|
|
FC.warn.apply(null, [ message ].concat(apiErrorObjs || [])); |
|
|
|
} |
|
|
|
|
|
|
|
if (!apiKey) { |
|
|
@@ -140,10 +136,10 @@ function transformOptions(sourceOptions, start, end, timezone, calendar) { |
|
|
|
} |
|
|
|
else if (data.items) { |
|
|
|
$.each(data.items, function(i, entry) { |
|
|
|
var url = entry.htmlLink; |
|
|
|
var url = entry.htmlLink || null; |
|
|
|
|
|
|
|
// make the URLs for each event show times in the correct timezone |
|
|
|
if (timezoneArg) { |
|
|
|
if (timezoneArg && url !== null) { |
|
|
|
url = injectQsComponent(url, 'ctz=' + timezoneArg); |
|
|
|
} |
|
|
|
|
|
|
|