This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch preview/calendar-staging in repository https://gitbox.apache.org/repos/asf/comdev-events-site.git
The following commit(s) were added to refs/heads/preview/calendar-staging by this push: new df97e2e Updated preview/calendar-staging from preview/calendar at fad04b6a1f8df8c1232fd98a94e29de83f5851dd df97e2e is described below commit df97e2e00c29423860235f6f9bd06d323f626652 Author: jenkins <bui...@apache.org> AuthorDate: Thu Apr 18 23:45:39 2024 +0000 Updated preview/calendar-staging from preview/calendar at fad04b6a1f8df8c1232fd98a94e29de83f5851dd Built from https://ci-builds.apache.org/job/Community%20Development/job/events-site/job/preview%252Fcalendar/7/ --- content/_pagefind/index/unknown_5abf874.pf_index | Bin 18539 -> 0 bytes content/_pagefind/index/unknown_bee9ede.pf_index | Bin 0 -> 18494 bytes content/_pagefind/pagefind-entry.json | 2 +- .../pagefind.unknown_ac10bee611d7706.pf_meta | Bin 0 -> 250 bytes .../pagefind.unknown_f9a32d5989bd66e.pf_meta | Bin 250 -> 0 bytes content/js/events-calendar.js | 125 +++++++++------------ 6 files changed, 57 insertions(+), 70 deletions(-) diff --git a/content/_pagefind/index/unknown_5abf874.pf_index b/content/_pagefind/index/unknown_5abf874.pf_index deleted file mode 100644 index d064e89..0000000 Binary files a/content/_pagefind/index/unknown_5abf874.pf_index and /dev/null differ diff --git a/content/_pagefind/index/unknown_bee9ede.pf_index b/content/_pagefind/index/unknown_bee9ede.pf_index new file mode 100644 index 0000000..fa65cfe Binary files /dev/null and b/content/_pagefind/index/unknown_bee9ede.pf_index differ diff --git a/content/_pagefind/pagefind-entry.json b/content/_pagefind/pagefind-entry.json index d068681..43380d9 100644 --- a/content/_pagefind/pagefind-entry.json +++ b/content/_pagefind/pagefind-entry.json @@ -1 +1 @@ -{"version":"1.0.3","languages":{"unknown":{"hash":"unknown_f9a32d5989bd66e","wasm":null,"page_count":21}}} \ No newline at end of file +{"version":"1.0.3","languages":{"unknown":{"hash":"unknown_ac10bee611d7706","wasm":null,"page_count":21}}} \ No newline at end of file diff --git a/content/_pagefind/pagefind.unknown_ac10bee611d7706.pf_meta b/content/_pagefind/pagefind.unknown_ac10bee611d7706.pf_meta new file mode 100644 index 0000000..953e6b2 Binary files /dev/null and b/content/_pagefind/pagefind.unknown_ac10bee611d7706.pf_meta differ diff --git a/content/_pagefind/pagefind.unknown_f9a32d5989bd66e.pf_meta b/content/_pagefind/pagefind.unknown_f9a32d5989bd66e.pf_meta deleted file mode 100644 index ae2b362..0000000 Binary files a/content/_pagefind/pagefind.unknown_f9a32d5989bd66e.pf_meta and /dev/null differ diff --git a/content/js/events-calendar.js b/content/js/events-calendar.js index fa5ad42..abd33ed 100644 --- a/content/js/events-calendar.js +++ b/content/js/events-calendar.js @@ -1,13 +1,4 @@ -// This uses the Google Calendar v3 API to fetch details of the -// events held in the shared Apache events calendar -// That calendar is available to any Apache member who asks, the ID -// of it is : nerseigospses068jd57bk5...@group.calendar.google.com -var CALENDAR_ID = "nerseigospses068jd57bk5...@group.calendar.google.com"; -// Google Calendar API key, valid for *.apache.org and localhost -var API_KEY = "AIzaSyDJkXq1faq2G5NkFkFTh9Sikdpc2YXTVXs"; - -// We only need read-only access for our needs -var SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']; +// Update the calendar page from the json file // Where to put things var events = $('#events'); @@ -15,70 +6,66 @@ if (!events) { events = $('body').append("<ul id='events'/>"); } -// Options -var now = (new Date()).toISOString(); -var opts = "?key=" + API_KEY - + "&timeMin=" + now - + "&singleEvents=true" - + "&orderBy=startTime" - + "&timezone=America/New_York" - + "&maxResults=20"; +function apply(response) { + events.empty(); + + var el = response['items']; + let reg = /T.*$/; + let official = /(ApacheCon|Roadshow|Community (O|o)ver Code)/; + if (el.length > 0) { + for (i = 0; i < el.length; i++) { + var ev = el[i]; + var when = ev.start.dateTime; + if (!when) { + when = ev.start.date; + } + when = when.replace(reg,""); + if (ev.end) { + var end = ev.end.dateTime; + if (!end) { + end = ev.end.date; + } + end = end.replace(reg,""); + if (end != when) { + when = when + " to " + end; + } + } + var link = null; + if (ev.description) { + var line1 = ev.description.split("\n")[0]; + if (line1.slice(0,7) === "http://" || + line1.slice(0,8) === "https://" + ) { + link = line1.trim(); + } + } + + var html = "<li>"; + if (link) { html += "<a href='" + link + "'>"; } + if (ev.summary.match(official)) { + html += "<b>" + ev.summary + "</b>"; + } else { + html += ev.summary; + } + if (link) { html += "</a>"; } + html += " - <i>" + when + "</i>"; + if (ev.location) { + html += "<br/>"+ev.location; + } + events.append(html); + } + } else { + events.append("<li><i>No events found, sorry</i></li>"); + } +} + // Fetch $.ajax({ type: 'GET', - url: encodeURI('https://www.googleapis.com/calendar/v3/calendars/' + CALENDAR_ID + '/events' + opts), + url: encodeURI('/js/calendar.json'), dataType: 'json', success: function (response) { - events.empty(); - - var el = response['items']; - let reg = /T.*$/; - let official = /(ApacheCon|Roadshow|Community (O|o)ver Code)/; - if (el.length > 0) { - for (i = 0; i < el.length; i++) { - var ev = el[i]; - var when = ev.start.dateTime; - if (!when) { - when = ev.start.date; - } - when = when.replace(reg,""); - if (ev.end) { - var end = ev.end.dateTime; - if (!end) { - end = ev.end.date; - } - end = end.replace(reg,""); - if (end != when) { - when = when + " to " + end; - } - } - var link = null; - if (ev.description) { - var line1 = ev.description.split("\n")[0]; - if (line1.slice(0,7) === "http://" || - line1.slice(0,8) === "https://" - ) { - link = line1.trim(); - } - } - - var html = "<li>"; - if (link) { html += "<a href='" + link + "'>"; } - if (ev.summary.match(official)) { - html += "<b>" + ev.summary + "</b>"; - } else { - html += ev.summary; - } - if (link) { html += "</a>"; } - html += " - <i>" + when + "</i>"; - if (ev.location) { - html += "<br/>"+ev.location; - } - events.append(html); - } - } else { - events.append("<li><i>No events found, sorry</i></li>"); - } + apply(response); }, error: function (response) { events.empty();