From 23050f1d4eb967b0dae25ad5972f86c8eca252f9 Mon Sep 17 00:00:00 2001 From: Freymaurer Date: Thu, 31 Aug 2023 21:05:32 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20nfdi4pla?= =?UTF-8?q?nts/nfdi4plants.github.io@56a36a9e2336a1cc44d5df9f41d53ceb03dbc?= =?UTF-8?q?deb=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/bundle.js | 129 -------------------------------------------- style/constants.css | 2 +- style/style.css | 2 +- 3 files changed, 2 insertions(+), 131 deletions(-) diff --git a/js/bundle.js b/js/bundle.js index e5674726..73374257 100644 --- a/js/bundle.js +++ b/js/bundle.js @@ -180414,132 +180414,3 @@ var mindmapDefinition65b51176 = /*#__PURE__*/Object.freeze({ __proto__: null, diagram: diagram }); - - -//the following is made by CMR -/** -* Create and download a file on click -* @params {string} filename - The name of the file with the ending -* @params {string} filebody - The contents of the file -*/ -function download(filename, fileBody) { - var element = document.createElement('a'); - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(fileBody)); - element.setAttribute('download', filename); - - element.style.display = 'none'; - document.body.appendChild(element); - - element.click(); - - document.body.removeChild(element); -} - - -/** -* Returns a date/time in ICS format -* @params {Object} dateTime - A date object you want to get the ICS format for. -* @returns {string} String with the date in ICS format -*/ -function convertToICSDate(dateTime) { - const year = dateTime.getFullYear().toString(); - const month = (dateTime.getMonth() + 1) < 10 ? "0" + (dateTime.getMonth() + 1).toString() : (dateTime.getMonth() + 1).toString(); - const day = dateTime.getDate() < 10 ? "0" + dateTime.getDate().toString() : dateTime.getDate().toString(); - const hours = dateTime.getHours() < 10 ? "0" + dateTime.getHours().toString() : dateTime.getHours().toString(); - const minutes = dateTime.getMinutes() < 10 ? "0" +dateTime.getMinutes().toString() : dateTime.getMinutes().toString(); - - return year + month + day + "T" + hours + minutes + "00"; -} - - -/** -* Creates and downloads an ICS file -* @params {string} timeZone - In the format Berlin/Germany -* @params {object} startTime - Vaild JS Date object in the event timezone -* @params {object} endTime - Vaild JS Date object in the event timezone -* @params {string} title -* @params {string} description -* @params {string} venueName -* @params {string} address -* @params {string} city -* @params {string} state -* @params {string} category -*/ -function createDownloadICSFile(timezone, startTime, endTime, title, description, venueName, address, city, state, category) { -const icsBody = 'BEGIN:VCALENDAR\n' + -'VERSION:2.0\n' + -'PRODID:DataPLANT\n' + -'CALSCALE:GREGORIAN\n' + -'METHOD:PUBLISH\n' + -'BEGIN:VTIMEZONE\n' + -'TZID:Europe/Berlin\n' + -'X-LIC-LOCATION:Europe/Berlin\n' + -'BEGIN:DAYLIGHT\n' + -'TZOFFSETFROM:+0100\n' + -'TZOFFSETTO:+0200\n' + -'TZNAME:CEST\n' + -'DTSTART:20020331T020000\n' + -'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\n' + -'END:DAYLIGHT\n' + -'BEGIN:STANDARD\n' + -'TZOFFSETFROM:+0200\n' + -'TZOFFSETTO:+0100\n' + -'TZNAME:CET\n' + -'DTSTART:20021027T030000\n' + -'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n' + -'END:STANDARD\n' + -'END:VTIMEZONE\n' + -'BEGIN:VEVENT\n' + -'SUMMARY:' + title + '\n' + -'UID:@Default\n' + -'SEQUENCE:0\n' + -'STATUS:CONFIRMED\n' + -'TRANSP:TRANSPARENT\n' + -'DTSTART;TZID=' + timezone + ':' + convertToICSDate(startTime) + '\n' + -'DTEND;TZID=' + timezone + ':' + convertToICSDate(endTime)+ '\n' + -'DTSTAMP:'+ convertToICSDate(new Date()) + '\n' + -'LOCATION:' + venueName + '\\n' + address + ', ' + city + ', ' + state + '\n' + -'DESCRIPTION:' + description + '\n' + -'CATEGORIES:' + category + '\n' + -'X-MICROSOFT-CDO-BUSYSTATUS:BUSY\n' + -'X-MICROSOFT-CDO-IMPORTANCE:1\n' + -'X-MICROSOFT-DISALLOW-COUNTER:FALSE\n' + -'BEGIN:VALARM\n' + -'TRIGGER:-PT15M\n' + -'ACTION:DISPLAY\n' + -'DESCRIPTION:Reminder\n' + -'END:VALARM\n' + -'END:VEVENT\n' + -'END:VCALENDAR\n'; - -download(title + '.ics', icsBody); -} - - -var downloadICSButton = document.getElementById('downloadICS'); - -downloadICSButton.addEventListener('click', function() { - // Die gewünschten Werte aus dem HTML-Element abrufen - var title = this.getAttribute('title'); - var startTime = new Date(this.getAttribute('data-start-time')); - var endTime = new Date(this.getAttribute('data-end-time')); - var description = this.getAttribute('data-description'); - var venueName = this.getAttribute('data-venue-name'); - var address = this.getAttribute('data-address'); - var city = this.getAttribute('data-city'); - var state = this.getAttribute('data-state'); - var category = this.getAttribute('data-category'); - - createDownloadICSFile( - 'Europe/Berlin', - startTime, - endTime, - title, - description, - venueName, - address, - city, - state, - category - ); -}); \ No newline at end of file diff --git a/style/constants.css b/style/constants.css index 81d9d13c..eb185840 100644 --- a/style/constants.css +++ b/style/constants.css @@ -1,3 +1,3 @@ -/*# sourceMappingURL=tmpRqc2Vn.tmp.map */ +/*# sourceMappingURL=tmpfw2ZLE.tmp.map */ diff --git a/style/style.css b/style/style.css index 4bcd4f32..7425b959 100644 --- a/style/style.css +++ b/style/style.css @@ -11947,4 +11947,4 @@ body { margin-bottom: unset !important; } -/*# sourceMappingURL=tmpucDtVm.tmp.map */ +/*# sourceMappingURL=tmpk1eFRM.tmp.map */