fullcalendar-rails 3.4.0.0 → 3.9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -1
  3. data/lib/fullcalendar-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/fullcalendar.js +15007 -15588
  5. data/vendor/assets/javascripts/fullcalendar/gcal.js +321 -177
  6. data/vendor/assets/javascripts/fullcalendar/lang/af.js +1 -1
  7. data/vendor/assets/javascripts/fullcalendar/lang/ar-dz.js +1 -1
  8. data/vendor/assets/javascripts/fullcalendar/lang/ar-kw.js +1 -1
  9. data/vendor/assets/javascripts/fullcalendar/lang/ar-ly.js +1 -1
  10. data/vendor/assets/javascripts/fullcalendar/lang/ar-ma.js +1 -1
  11. data/vendor/assets/javascripts/fullcalendar/lang/ar-sa.js +1 -1
  12. data/vendor/assets/javascripts/fullcalendar/lang/ar-tn.js +1 -1
  13. data/vendor/assets/javascripts/fullcalendar/lang/ar.js +1 -1
  14. data/vendor/assets/javascripts/fullcalendar/lang/bg.js +1 -1
  15. data/vendor/assets/javascripts/fullcalendar/lang/bs.js +1 -0
  16. data/vendor/assets/javascripts/fullcalendar/lang/ca.js +1 -1
  17. data/vendor/assets/javascripts/fullcalendar/lang/cs.js +1 -1
  18. data/vendor/assets/javascripts/fullcalendar/lang/da.js +1 -1
  19. data/vendor/assets/javascripts/fullcalendar/lang/de-at.js +1 -1
  20. data/vendor/assets/javascripts/fullcalendar/lang/de-ch.js +1 -1
  21. data/vendor/assets/javascripts/fullcalendar/lang/de.js +1 -1
  22. data/vendor/assets/javascripts/fullcalendar/lang/el.js +1 -1
  23. data/vendor/assets/javascripts/fullcalendar/lang/en-au.js +1 -1
  24. data/vendor/assets/javascripts/fullcalendar/lang/en-ca.js +1 -1
  25. data/vendor/assets/javascripts/fullcalendar/lang/en-gb.js +1 -1
  26. data/vendor/assets/javascripts/fullcalendar/lang/en-ie.js +1 -1
  27. data/vendor/assets/javascripts/fullcalendar/lang/en-nz.js +1 -1
  28. data/vendor/assets/javascripts/fullcalendar/lang/es-do.js +1 -1
  29. data/vendor/assets/javascripts/fullcalendar/lang/es-us.js +1 -0
  30. data/vendor/assets/javascripts/fullcalendar/lang/es.js +1 -1
  31. data/vendor/assets/javascripts/fullcalendar/lang/et.js +1 -1
  32. data/vendor/assets/javascripts/fullcalendar/lang/eu.js +1 -1
  33. data/vendor/assets/javascripts/fullcalendar/lang/fa.js +1 -1
  34. data/vendor/assets/javascripts/fullcalendar/lang/fi.js +1 -1
  35. data/vendor/assets/javascripts/fullcalendar/lang/fr-ca.js +1 -1
  36. data/vendor/assets/javascripts/fullcalendar/lang/fr-ch.js +1 -1
  37. data/vendor/assets/javascripts/fullcalendar/lang/fr.js +1 -1
  38. data/vendor/assets/javascripts/fullcalendar/lang/gl.js +1 -1
  39. data/vendor/assets/javascripts/fullcalendar/lang/he.js +1 -1
  40. data/vendor/assets/javascripts/fullcalendar/lang/hi.js +1 -1
  41. data/vendor/assets/javascripts/fullcalendar/lang/hr.js +1 -1
  42. data/vendor/assets/javascripts/fullcalendar/lang/hu.js +1 -1
  43. data/vendor/assets/javascripts/fullcalendar/lang/id.js +1 -1
  44. data/vendor/assets/javascripts/fullcalendar/lang/is.js +1 -1
  45. data/vendor/assets/javascripts/fullcalendar/lang/it.js +1 -1
  46. data/vendor/assets/javascripts/fullcalendar/lang/ja.js +1 -1
  47. data/vendor/assets/javascripts/fullcalendar/lang/ka.js +1 -0
  48. data/vendor/assets/javascripts/fullcalendar/lang/kk.js +1 -1
  49. data/vendor/assets/javascripts/fullcalendar/lang/ko.js +1 -1
  50. data/vendor/assets/javascripts/fullcalendar/lang/lb.js +1 -1
  51. data/vendor/assets/javascripts/fullcalendar/lang/lt.js +1 -1
  52. data/vendor/assets/javascripts/fullcalendar/lang/lv.js +1 -1
  53. data/vendor/assets/javascripts/fullcalendar/lang/mk.js +1 -1
  54. data/vendor/assets/javascripts/fullcalendar/lang/ms-my.js +1 -1
  55. data/vendor/assets/javascripts/fullcalendar/lang/ms.js +1 -1
  56. data/vendor/assets/javascripts/fullcalendar/lang/nb.js +1 -1
  57. data/vendor/assets/javascripts/fullcalendar/lang/nl-be.js +1 -1
  58. data/vendor/assets/javascripts/fullcalendar/lang/nl.js +1 -1
  59. data/vendor/assets/javascripts/fullcalendar/lang/nn.js +1 -1
  60. data/vendor/assets/javascripts/fullcalendar/lang/pl.js +1 -1
  61. data/vendor/assets/javascripts/fullcalendar/lang/pt-br.js +1 -1
  62. data/vendor/assets/javascripts/fullcalendar/lang/pt.js +1 -1
  63. data/vendor/assets/javascripts/fullcalendar/lang/ro.js +1 -1
  64. data/vendor/assets/javascripts/fullcalendar/lang/ru.js +1 -1
  65. data/vendor/assets/javascripts/fullcalendar/lang/sk.js +1 -1
  66. data/vendor/assets/javascripts/fullcalendar/lang/sl.js +1 -1
  67. data/vendor/assets/javascripts/fullcalendar/lang/sq.js +1 -0
  68. data/vendor/assets/javascripts/fullcalendar/lang/sr-cyrl.js +1 -1
  69. data/vendor/assets/javascripts/fullcalendar/lang/sr.js +1 -1
  70. data/vendor/assets/javascripts/fullcalendar/lang/sv.js +1 -1
  71. data/vendor/assets/javascripts/fullcalendar/lang/th.js +1 -1
  72. data/vendor/assets/javascripts/fullcalendar/lang/tr.js +1 -1
  73. data/vendor/assets/javascripts/fullcalendar/lang/uk.js +1 -1
  74. data/vendor/assets/javascripts/fullcalendar/lang/vi.js +1 -1
  75. data/vendor/assets/javascripts/fullcalendar/lang/zh-cn.js +1 -1
  76. data/vendor/assets/javascripts/fullcalendar/lang/zh-tw.js +1 -1
  77. data/vendor/assets/javascripts/fullcalendar/locale-all.js +6 -5
  78. data/vendor/assets/stylesheets/fullcalendar.css +795 -915
  79. data/vendor/assets/stylesheets/fullcalendar.print.css +62 -94
  80. metadata +7 -3
@@ -1,180 +1,324 @@
1
1
  /*!
2
- * FullCalendar v3.4.0 Google Calendar Plugin
2
+ * FullCalendar v3.9.0
3
3
  * Docs & License: https://fullcalendar.io/
4
- * (c) 2017 Adam Shaw
4
+ * (c) 2018 Adam Shaw
5
5
  */
6
-
7
- (function(factory) {
8
- if (typeof define === 'function' && define.amd) {
9
- define([ 'jquery' ], factory);
10
- }
11
- else if (typeof exports === 'object') { // Node/CommonJS
12
- module.exports = factory(require('jquery'));
13
- }
14
- else {
15
- factory(jQuery);
16
- }
17
- })(function($) {
18
-
19
-
20
- var API_BASE = 'https://www.googleapis.com/calendar/v3/calendars';
21
- var FC = $.fullCalendar;
22
- var applyAll = FC.applyAll;
23
-
24
-
25
- FC.sourceNormalizers.push(function(sourceOptions) {
26
- var googleCalendarId = sourceOptions.googleCalendarId;
27
- var url = sourceOptions.url;
28
- var match;
29
-
30
- // if the Google Calendar ID hasn't been explicitly defined
31
- if (!googleCalendarId && url) {
32
-
33
- // detect if the ID was specified as a single string.
34
- // will match calendars like "asdf1234@calendar.google.com" in addition to person email calendars.
35
- if (/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(url)) {
36
- googleCalendarId = url;
37
- }
38
- // try to scrape it out of a V1 or V3 API feed URL
39
- else if (
40
- (match = /^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(url)) ||
41
- (match = /^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(url))
42
- ) {
43
- googleCalendarId = decodeURIComponent(match[1]);
44
- }
45
-
46
- if (googleCalendarId) {
47
- sourceOptions.googleCalendarId = googleCalendarId;
48
- }
49
- }
50
-
51
-
52
- if (googleCalendarId) { // is this a Google Calendar?
53
-
54
- // make each Google Calendar source uneditable by default
55
- if (sourceOptions.editable == null) {
56
- sourceOptions.editable = false;
57
- }
58
-
59
- // We want removeEventSource to work, but it won't know about the googleCalendarId primitive.
60
- // Shoehorn it into the url, which will function as the unique primitive. Won't cause side effects.
61
- // This hack is obsolete since 2.2.3, but keep it so this plugin file is compatible with old versions.
62
- sourceOptions.url = googleCalendarId;
63
- }
64
- });
65
-
66
-
67
- FC.sourceFetchers.push(function(sourceOptions, start, end, timezone) {
68
- if (sourceOptions.googleCalendarId) {
69
- return transformOptions(sourceOptions, start, end, timezone, this); // `this` is the calendar
70
- }
71
- });
72
-
73
-
74
- function transformOptions(sourceOptions, start, end, timezone, calendar) {
75
- var url = API_BASE + '/' + encodeURIComponent(sourceOptions.googleCalendarId) + '/events?callback=?'; // jsonp
76
- var apiKey = sourceOptions.googleCalendarApiKey || calendar.opt('googleCalendarApiKey');
77
- var success = sourceOptions.success;
78
- var data;
79
- var timezoneArg; // populated when a specific timezone. escaped to Google's liking
80
-
81
- function reportError(message, apiErrorObjs) {
82
- var errorObjs = apiErrorObjs || [ { message: message } ]; // to be passed into error handlers
83
-
84
- // call error handlers
85
- (sourceOptions.googleCalendarError || $.noop).apply(calendar, errorObjs);
86
- (calendar.opt('googleCalendarError') || $.noop).apply(calendar, errorObjs);
87
-
88
- // print error to debug console
89
- FC.warn.apply(null, [ message ].concat(apiErrorObjs || []));
90
- }
91
-
92
- if (!apiKey) {
93
- reportError("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/");
94
- return {}; // an empty source to use instead. won't fetch anything.
95
- }
96
-
97
- // The API expects an ISO8601 datetime with a time and timezone part.
98
- // Since the calendar's timezone offset isn't always known, request the date in UTC and pad it by a day on each
99
- // side, guaranteeing we will receive all events in the desired range, albeit a superset.
100
- // .utc() will set a zone and give it a 00:00:00 time.
101
- if (!start.hasZone()) {
102
- start = start.clone().utc().add(-1, 'day');
103
- }
104
- if (!end.hasZone()) {
105
- end = end.clone().utc().add(1, 'day');
106
- }
107
-
108
- // when sending timezone names to Google, only accepts underscores, not spaces
109
- if (timezone && timezone != 'local') {
110
- timezoneArg = timezone.replace(' ', '_');
111
- }
112
-
113
- data = $.extend({}, sourceOptions.data || {}, {
114
- key: apiKey,
115
- timeMin: start.format(),
116
- timeMax: end.format(),
117
- timeZone: timezoneArg,
118
- singleEvents: true,
119
- maxResults: 9999
120
- });
121
-
122
- return $.extend({}, sourceOptions, {
123
- googleCalendarId: null, // prevents source-normalizing from happening again
124
- url: url,
125
- data: data,
126
- startParam: false, // `false` omits this parameter. we already included it above
127
- endParam: false, // same
128
- timezoneParam: false, // same
129
- success: function(data) {
130
- var events = [];
131
- var successArgs;
132
- var successRes;
133
-
134
- if (data.error) {
135
- reportError('Google Calendar API: ' + data.error.message, data.error.errors);
136
- }
137
- else if (data.items) {
138
- $.each(data.items, function(i, entry) {
139
- var url = entry.htmlLink || null;
140
-
141
- // make the URLs for each event show times in the correct timezone
142
- if (timezoneArg && url !== null) {
143
- url = injectQsComponent(url, 'ctz=' + timezoneArg);
144
- }
145
-
146
- events.push({
147
- id: entry.id,
148
- title: entry.summary,
149
- start: entry.start.dateTime || entry.start.date, // try timed. will fall back to all-day
150
- end: entry.end.dateTime || entry.end.date, // same
151
- url: url,
152
- location: entry.location,
153
- description: entry.description
154
- });
155
- });
156
-
157
- // call the success handler(s) and allow it to return a new events array
158
- successArgs = [ events ].concat(Array.prototype.slice.call(arguments, 1)); // forward other jq args
159
- successRes = applyAll(success, this, successArgs);
160
- if ($.isArray(successRes)) {
161
- return successRes;
162
- }
163
- }
164
-
165
- return events;
166
- }
167
- });
168
- }
169
-
170
-
171
- // Injects a string like "arg=value" into the querystring of a URL
172
- function injectQsComponent(url, component) {
173
- // inject it after the querystring but before the fragment
174
- return url.replace(/(\?.*?)?(#|$)/, function(whole, qs, hash) {
175
- return (qs ? qs + '&' : '?') + component + hash;
176
- });
177
- }
178
-
179
-
180
- });
6
+ (function webpackUniversalModuleDefinition(root, factory) {
7
+ if(typeof exports === 'object' && typeof module === 'object')
8
+ module.exports = factory(require("fullcalendar"), require("jquery"));
9
+ else if(typeof define === 'function' && define.amd)
10
+ define(["fullcalendar", "jquery"], factory);
11
+ else if(typeof exports === 'object')
12
+ factory(require("fullcalendar"), require("jquery"));
13
+ else
14
+ factory(root["FullCalendar"], root["jQuery"]);
15
+ })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__) {
16
+ return /******/ (function(modules) { // webpackBootstrap
17
+ /******/ // The module cache
18
+ /******/ var installedModules = {};
19
+ /******/
20
+ /******/ // The require function
21
+ /******/ function __webpack_require__(moduleId) {
22
+ /******/
23
+ /******/ // Check if module is in cache
24
+ /******/ if(installedModules[moduleId]) {
25
+ /******/ return installedModules[moduleId].exports;
26
+ /******/ }
27
+ /******/ // Create a new module (and put it into the cache)
28
+ /******/ var module = installedModules[moduleId] = {
29
+ /******/ i: moduleId,
30
+ /******/ l: false,
31
+ /******/ exports: {}
32
+ /******/ };
33
+ /******/
34
+ /******/ // Execute the module function
35
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
36
+ /******/
37
+ /******/ // Flag the module as loaded
38
+ /******/ module.l = true;
39
+ /******/
40
+ /******/ // Return the exports of the module
41
+ /******/ return module.exports;
42
+ /******/ }
43
+ /******/
44
+ /******/
45
+ /******/ // expose the modules object (__webpack_modules__)
46
+ /******/ __webpack_require__.m = modules;
47
+ /******/
48
+ /******/ // expose the module cache
49
+ /******/ __webpack_require__.c = installedModules;
50
+ /******/
51
+ /******/ // define getter function for harmony exports
52
+ /******/ __webpack_require__.d = function(exports, name, getter) {
53
+ /******/ if(!__webpack_require__.o(exports, name)) {
54
+ /******/ Object.defineProperty(exports, name, {
55
+ /******/ configurable: false,
56
+ /******/ enumerable: true,
57
+ /******/ get: getter
58
+ /******/ });
59
+ /******/ }
60
+ /******/ };
61
+ /******/
62
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
63
+ /******/ __webpack_require__.n = function(module) {
64
+ /******/ var getter = module && module.__esModule ?
65
+ /******/ function getDefault() { return module['default']; } :
66
+ /******/ function getModuleExports() { return module; };
67
+ /******/ __webpack_require__.d(getter, 'a', getter);
68
+ /******/ return getter;
69
+ /******/ };
70
+ /******/
71
+ /******/ // Object.prototype.hasOwnProperty.call
72
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
73
+ /******/
74
+ /******/ // __webpack_public_path__
75
+ /******/ __webpack_require__.p = "";
76
+ /******/
77
+ /******/ // Load entry module and return exports
78
+ /******/ return __webpack_require__(__webpack_require__.s = 266);
79
+ /******/ })
80
+ /************************************************************************/
81
+ /******/ ({
82
+
83
+ /***/ 1:
84
+ /***/ (function(module, exports) {
85
+
86
+ module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
87
+
88
+ /***/ }),
89
+
90
+ /***/ 2:
91
+ /***/ (function(module, exports) {
92
+
93
+ /*
94
+ derived from:
95
+ https://github.com/Microsoft/tslib/blob/v1.6.0/tslib.js
96
+
97
+ only include the helpers we need, to keep down filesize
98
+ */
99
+ var extendStatics = Object.setPrototypeOf ||
100
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
101
+ function (d, b) { for (var p in b)
102
+ if (b.hasOwnProperty(p))
103
+ d[p] = b[p]; };
104
+ exports.__extends = function (d, b) {
105
+ extendStatics(d, b);
106
+ function __() { this.constructor = d; }
107
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
108
+ };
109
+
110
+
111
+ /***/ }),
112
+
113
+ /***/ 266:
114
+ /***/ (function(module, exports, __webpack_require__) {
115
+
116
+ Object.defineProperty(exports, "__esModule", { value: true });
117
+ var exportHooks = __webpack_require__(1);
118
+ var GcalEventSource_1 = __webpack_require__(267);
119
+ exportHooks.EventSourceParser.registerClass(GcalEventSource_1.default);
120
+ exportHooks.GcalEventSource = GcalEventSource_1.default;
121
+
122
+
123
+ /***/ }),
124
+
125
+ /***/ 267:
126
+ /***/ (function(module, exports, __webpack_require__) {
127
+
128
+ Object.defineProperty(exports, "__esModule", { value: true });
129
+ var tslib_1 = __webpack_require__(2);
130
+ var $ = __webpack_require__(3);
131
+ var fullcalendar_1 = __webpack_require__(1);
132
+ var GcalEventSource = /** @class */ (function (_super) {
133
+ tslib_1.__extends(GcalEventSource, _super);
134
+ function GcalEventSource() {
135
+ return _super !== null && _super.apply(this, arguments) || this;
136
+ }
137
+ GcalEventSource.parse = function (rawInput, calendar) {
138
+ var rawProps;
139
+ if (typeof rawInput === 'object') {
140
+ rawProps = rawInput;
141
+ }
142
+ else if (typeof rawInput === 'string') {
143
+ rawProps = { url: rawInput }; // url will be parsed with parseGoogleCalendarId
144
+ }
145
+ if (rawProps) {
146
+ return fullcalendar_1.EventSource.parse.call(this, rawProps, calendar);
147
+ }
148
+ return false;
149
+ };
150
+ GcalEventSource.prototype.fetch = function (start, end, timezone) {
151
+ var _this = this;
152
+ var url = this.buildUrl();
153
+ var requestParams = this.buildRequestParams(start, end, timezone);
154
+ var ajaxSettings = this.ajaxSettings || {};
155
+ var onSuccess = ajaxSettings.success;
156
+ if (!requestParams) {
157
+ return fullcalendar_1.Promise.reject();
158
+ }
159
+ this.calendar.pushLoading();
160
+ return fullcalendar_1.Promise.construct(function (onResolve, onReject) {
161
+ $.ajax($.extend({}, // destination
162
+ fullcalendar_1.JsonFeedEventSource.AJAX_DEFAULTS, ajaxSettings, {
163
+ url: url,
164
+ data: requestParams,
165
+ success: function (responseData, status, xhr) {
166
+ var rawEventDefs;
167
+ var successRes;
168
+ _this.calendar.popLoading();
169
+ if (responseData.error) {
170
+ _this.reportError('Google Calendar API: ' + responseData.error.message, responseData.error.errors);
171
+ onReject();
172
+ }
173
+ else if (responseData.items) {
174
+ rawEventDefs = _this.gcalItemsToRawEventDefs(responseData.items, requestParams.timeZone);
175
+ successRes = fullcalendar_1.applyAll(onSuccess, _this, [responseData, status, xhr]); // passthru
176
+ if ($.isArray(successRes)) {
177
+ rawEventDefs = successRes;
178
+ }
179
+ onResolve(_this.parseEventDefs(rawEventDefs));
180
+ }
181
+ },
182
+ error: function (xhr, statusText, errorThrown) {
183
+ _this.reportError('Google Calendar network failure: ' + statusText, [xhr, errorThrown]);
184
+ _this.calendar.popLoading();
185
+ onReject();
186
+ }
187
+ }));
188
+ });
189
+ };
190
+ GcalEventSource.prototype.gcalItemsToRawEventDefs = function (items, gcalTimezone) {
191
+ var _this = this;
192
+ return items.map(function (item) {
193
+ return _this.gcalItemToRawEventDef(item, gcalTimezone);
194
+ });
195
+ };
196
+ GcalEventSource.prototype.gcalItemToRawEventDef = function (item, gcalTimezone) {
197
+ var url = item.htmlLink || null;
198
+ // make the URLs for each event show times in the correct timezone
199
+ if (url && gcalTimezone) {
200
+ url = injectQsComponent(url, 'ctz=' + gcalTimezone);
201
+ }
202
+ return {
203
+ id: item.id,
204
+ title: item.summary,
205
+ start: item.start.dateTime || item.start.date,
206
+ end: item.end.dateTime || item.end.date,
207
+ url: url,
208
+ location: item.location,
209
+ description: item.description
210
+ };
211
+ };
212
+ GcalEventSource.prototype.buildUrl = function () {
213
+ return GcalEventSource.API_BASE + '/' +
214
+ encodeURIComponent(this.googleCalendarId) +
215
+ '/events?callback=?'; // jsonp
216
+ };
217
+ GcalEventSource.prototype.buildRequestParams = function (start, end, timezone) {
218
+ var apiKey = this.googleCalendarApiKey || this.calendar.opt('googleCalendarApiKey');
219
+ var params;
220
+ if (!apiKey) {
221
+ this.reportError('Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/');
222
+ return null;
223
+ }
224
+ // The API expects an ISO8601 datetime with a time and timezone part.
225
+ // Since the calendar's timezone offset isn't always known, request the date in UTC and pad it by a day on each
226
+ // side, guaranteeing we will receive all events in the desired range, albeit a superset.
227
+ // .utc() will set a zone and give it a 00:00:00 time.
228
+ if (!start.hasZone()) {
229
+ start = start.clone().utc().add(-1, 'day');
230
+ }
231
+ if (!end.hasZone()) {
232
+ end = end.clone().utc().add(1, 'day');
233
+ }
234
+ params = $.extend(this.ajaxSettings.data || {}, {
235
+ key: apiKey,
236
+ timeMin: start.format(),
237
+ timeMax: end.format(),
238
+ singleEvents: true,
239
+ maxResults: 9999
240
+ });
241
+ if (timezone && timezone !== 'local') {
242
+ // when sending timezone names to Google, only accepts underscores, not spaces
243
+ params.timeZone = timezone.replace(' ', '_');
244
+ }
245
+ return params;
246
+ };
247
+ GcalEventSource.prototype.reportError = function (message, apiErrorObjs) {
248
+ var calendar = this.calendar;
249
+ var calendarOnError = calendar.opt('googleCalendarError');
250
+ var errorObjs = apiErrorObjs || [{ message: message }]; // to be passed into error handlers
251
+ if (this.googleCalendarError) {
252
+ this.googleCalendarError.apply(calendar, errorObjs);
253
+ }
254
+ if (calendarOnError) {
255
+ calendarOnError.apply(calendar, errorObjs);
256
+ }
257
+ // print error to debug console
258
+ fullcalendar_1.warn.apply(null, [message].concat(apiErrorObjs || []));
259
+ };
260
+ GcalEventSource.prototype.getPrimitive = function () {
261
+ return this.googleCalendarId;
262
+ };
263
+ GcalEventSource.prototype.applyManualStandardProps = function (rawProps) {
264
+ var superSuccess = fullcalendar_1.EventSource.prototype.applyManualStandardProps.apply(this, arguments);
265
+ var googleCalendarId = rawProps.googleCalendarId;
266
+ if (googleCalendarId == null && rawProps.url) {
267
+ googleCalendarId = parseGoogleCalendarId(rawProps.url);
268
+ }
269
+ if (googleCalendarId != null) {
270
+ this.googleCalendarId = googleCalendarId;
271
+ return superSuccess;
272
+ }
273
+ return false;
274
+ };
275
+ GcalEventSource.prototype.applyMiscProps = function (rawProps) {
276
+ if (!this.ajaxSettings) {
277
+ this.ajaxSettings = {};
278
+ }
279
+ $.extend(this.ajaxSettings, rawProps);
280
+ };
281
+ GcalEventSource.API_BASE = 'https://www.googleapis.com/calendar/v3/calendars';
282
+ return GcalEventSource;
283
+ }(fullcalendar_1.EventSource));
284
+ exports.default = GcalEventSource;
285
+ GcalEventSource.defineStandardProps({
286
+ // manually process...
287
+ url: false,
288
+ googleCalendarId: false,
289
+ // automatically transfer...
290
+ googleCalendarApiKey: true,
291
+ googleCalendarError: true
292
+ });
293
+ function parseGoogleCalendarId(url) {
294
+ var match;
295
+ // detect if the ID was specified as a single string.
296
+ // will match calendars like "asdf1234@calendar.google.com" in addition to person email calendars.
297
+ if (/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(url)) {
298
+ return url;
299
+ }
300
+ else if ((match = /^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(url)) ||
301
+ (match = /^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(url))) {
302
+ return decodeURIComponent(match[1]);
303
+ }
304
+ }
305
+ // Injects a string like "arg=value" into the querystring of a URL
306
+ function injectQsComponent(url, component) {
307
+ // inject it after the querystring but before the fragment
308
+ return url.replace(/(\?.*?)?(#|$)/, function (whole, qs, hash) {
309
+ return (qs ? qs + '&' : '?') + component + hash;
310
+ });
311
+ }
312
+
313
+
314
+ /***/ }),
315
+
316
+ /***/ 3:
317
+ /***/ (function(module, exports) {
318
+
319
+ module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
320
+
321
+ /***/ })
322
+
323
+ /******/ });
324
+ });