[SPIP] ~spip v3.2.0-->v3.2.1
[lhc/web/www.git] / www / plugins-dist / organiseur / lib / fullcalendar / gcal.min.js
index 02e7ea4..bb18cc0 100644 (file)
@@ -1,6 +1,6 @@
 /*!
- * FullCalendar v3.2.0 Google Calendar Plugin
+ * FullCalendar v3.5.1 Google Calendar Plugin
  * Docs & License: https://fullcalendar.io/
  * (c) 2017 Adam Shaw
  */
-!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){function a(a,t,d,c,i){function s(o,r){var l=r||[{message:o}];(a.googleCalendarError||e.noop).apply(i,l),(i.options.googleCalendarError||e.noop).apply(i,l),n.warn.apply(null,[o].concat(r||[]))}var u,g,p=r+"/"+encodeURIComponent(a.googleCalendarId)+"/events?callback=?",m=a.googleCalendarApiKey||i.options.googleCalendarApiKey,f=a.success;return m?(t.hasZone()||(t=t.clone().utc().add(-1,"day")),d.hasZone()||(d=d.clone().utc().add(1,"day")),c&&"local"!=c&&(g=c.replace(" ","_")),u=e.extend({},a.data||{},{key:m,timeMin:t.format(),timeMax:d.format(),timeZone:g,singleEvents:!0,maxResults:9999}),e.extend({},a,{googleCalendarId:null,url:p,data:u,startParam:!1,endParam:!1,timezoneParam:!1,success:function(a){var r,n,t=[];if(a.error)s("Google Calendar API: "+a.error.message,a.error.errors);else if(a.items&&(e.each(a.items,function(e,a){var r=a.htmlLink||null;g&&null!==r&&(r=o(r,"ctz="+g)),t.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})}),r=[t].concat(Array.prototype.slice.call(arguments,1)),n=l(f,this,r),e.isArray(n)))return n;return t}})):(s("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/"),{})}function o(e,a){return e.replace(/(\?.*?)?(#|$)/,function(e,o,r){return(o?o+"&":"?")+a+r})}var r="https://www.googleapis.com/calendar/v3/calendars",n=e.fullCalendar,l=n.applyAll;n.sourceNormalizers.push(function(e){var a,o=e.googleCalendarId,r=e.url;!o&&r&&(/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(r)?o=r:((a=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(r))||(a=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(r)))&&(o=decodeURIComponent(a[1])),o&&(e.googleCalendarId=o)),o&&(null==e.editable&&(e.editable=!1),e.url=o)}),n.sourceFetchers.push(function(e,o,r,n){if(e.googleCalendarId)return a(e,o,r,n,this)})});
\ No newline at end of file
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){function r(e){var r;return/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(e)?e:(r=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(e))||(r=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(e))?decodeURIComponent(r[1]):void 0}function a(e,r){return e.replace(/(\?.*?)?(#|$)/,function(e,a,t){return(a?a+"&":"?")+r+t})}var t=e.fullCalendar,o=t.Promise,n=t.EventSource,l=t.JsonFeedEventSource,i=t.EventSourceParser,s=t.applyAll,c=n.extend({googleCalendarApiKey:null,googleCalendarId:null,googleCalendarError:null,ajaxSettings:null,fetch:function(r,a,t){var n=this,i=this.buildUrl(),c=this.buildRequestParams(r,a,t),u=this.ajaxSettings,d=u.success;return c?o.construct(function(r,a){e.ajax(e.extend({},l.AJAX_DEFAULTS,u,{url:i,data:c,success:function(t){var o,l;t.error?(n.reportError("Google Calendar API: "+t.error.message,t.error.errors),a()):t.items&&(o=n.gcalItemsToRawEventDefs(t.items,c.timeZone),l=s(d,this,[o].concat(Array.prototype.slice.call(arguments,1))),e.isArray(l)&&(o=l),r(n.parseEventDefs(o)))}}))}):o.reject()},gcalItemsToRawEventDefs:function(e,r){var a=this;return e.map(function(e){return a.gcalItemToRawEventDef(e,r)})},gcalItemToRawEventDef:function(e,r){var t=e.htmlLink||null;return t&&r&&(t=a(t,"ctz="+r)),{id:e.id,title:e.summary,start:e.start.dateTime||e.start.date,end:e.end.dateTime||e.end.date,url:t,location:e.location,description:e.description}},buildUrl:function(){return c.API_BASE+"/"+encodeURIComponent(this.googleCalendarId)+"/events?callback=?"},buildRequestParams:function(r,a,t){var o,n=this.googleCalendarApiKey||this.calendar.opt("googleCalendarApiKey");return n?(r.hasZone()||(r=r.clone().utc().add(-1,"day")),a.hasZone()||(a=a.clone().utc().add(1,"day")),o=e.extend(this.ajaxSettings.data||{},{key:n,timeMin:r.format(),timeMax:a.format(),singleEvents:!0,maxResults:9999}),t&&"local"!==t&&(o.timeZone=t.replace(" ","_")),o):(this.reportError("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/"),null)},reportError:function(e,r){var a=this.calendar,o=a.opt("googleCalendarError"),n=r||[{message:e}];this.googleCalendarError&&this.googleCalendarError.apply(a,n),o&&o.apply(a,n),t.warn.apply(null,[e].concat(r||[]))},getPrimitive:function(){return this.googleCalendarId},applyManualRawProps:function(e){var a=n.prototype.applyManualRawProps.apply(this,arguments),t=e.googleCalendarId;return null==t&&e.url&&(t=r(e.url)),null!=t&&(this.googleCalendarId=t,a)},applyOtherRawProps:function(e){this.ajaxSettings=e}});c.API_BASE="https://www.googleapis.com/calendar/v3/calendars",c.allowRawProps({url:!1,googleCalendarId:!1,googleCalendarApiKey:!0,googleCalendarError:!0}),c.parse=function(e,r){var a;return"object"==typeof e?a=e:"string"==typeof e&&(a={url:e}),!!a&&n.parse.call(this,a,r)},i.registerClass(c),t.GcalEventSource=c});
\ No newline at end of file