|
|
|
@@ -1,2 +1,2 @@
|
|
|
|
|
(()=>{"use strict";var e={953:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t,n){this.reminderPrefix="Erinnerung: ",this.icsContent=e,this.reminderDays=t,this.reminderHours=n}modifyEvents(){return this.icsContent.replace(/BEGIN:VEVENT.*?END:VEVENT/gs,(e=>{const t=e.match(/SUMMARY:(.*)\r\n/),n=t?t[1]:"",r=this.createTriggerValue(),o=this.createVAlarmString(this.reminderPrefix+n,r);return e.replace(/END:VEVENT/,o+"END:VEVENT")}))}createVAlarmString(e,t){let n="BEGIN:VALARM\r\n";return n+="ACTION:DISPLAY\r\n",n+=`DESCRIPTION:${e}\r\n`,n+=`TRIGGER:${t}\r\n`,n+="END:VALARM\r\n",n}createTriggerValue(){const e=0===this.reminderHours?0:24-this.reminderHours;let t=this.reminderDays;return 1===t&&(t=0),`-P${t}DT${e}H0M0S`}}},519:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(953)),s=n(412);function d(e){!function(){const e=document.getElementById("download-area");e&&e.classList.remove("show-download-area")}();const t=document.getElementById("ical-upload"),n=document.getElementById("reminder-days-select"),r=document.getElementById("reminder-hours-select"),s=parseInt(n.value,10),d=parseInt(r.value,10),i=t.files?t.files[0]:null;if(i){console.log("File uploaded:",i.name);const e=new FileReader;e.onload=e=>{var t;const n=null===(t=e.target)||void 0===t?void 0:t.result;if("string"==typeof n){console.log("File content readable..");const e=new o.default(n,s,d).modifyEvents(),t=function(e){const t=e.lastIndexOf(".");return-1===t?e+" with reminders":e.substring(0,t)+" with reminders"+e.substring(t)}(i.name),r=new Blob([e],{type:"text/calendar"});!function(e,t){const n=document.getElementById("download-area"),r=document.getElementById("download-button");n&&r&&(r.href=t,r.download=e,setTimeout((()=>n.classList.add("show-download-area")),0),document.getElementById("work-button").disabled=!0)}(t,URL.createObjectURL(r))}},e.readAsText(i)}}document.addEventListener("DOMContentLoaded",(()=>{console.log("Loading the WebApp Version "+s.version+"..."),document.getElementById("footer-version").innerText=`Version: ${s.version}`;const e=document.getElementById("work-button");document.getElementById("ical-upload").addEventListener("change",(()=>{e.disabled=!1})),e.addEventListener("click",d)}))},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="0.1.4"}},t={};!function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}(519)})();
|
|
|
|
|
(()=>{"use strict";var e={953:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t,n){this.reminderPrefix="Erinnerung: ",this.icsContent=e,this.reminderDays=t,this.reminderHours=n}modifyEvents(){return this.icsContent.replace(/BEGIN:VEVENT.*?END:VEVENT/gs,(e=>{const t=e.match(/SUMMARY:(.*)\r\n/),n=t?t[1]:"",r=this.createTriggerValue(),o=this.createVAlarmString(this.reminderPrefix+n,r);return e.replace(/END:VEVENT/,o+"END:VEVENT")}))}createVAlarmString(e,t){let n="BEGIN:VALARM\r\n";return n+="ACTION:DISPLAY\r\n",n+=`DESCRIPTION:${e}\r\n`,n+=`TRIGGER:${t}\r\n`,n+="END:VALARM\r\n",n}createTriggerValue(){const e=0===this.reminderHours?0:24-this.reminderHours;let t=this.reminderDays;return 1===t&&(t=0),`-P${t}DT${e}H0M0S`}}},519:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(953)),s=n(412);function d(e){!function(){const e=document.getElementById("download-area");e&&e.classList.remove("show-download-area")}();const t=document.getElementById("ical-upload"),n=document.getElementById("reminder-days-select"),r=document.getElementById("reminder-hours-select"),s=parseInt(n.value,10),d=parseInt(r.value,10),i=t.files?t.files[0]:null;if(i){console.log("File uploaded:",i.name);const e=new FileReader;e.onload=e=>{var t;const n=null===(t=e.target)||void 0===t?void 0:t.result;if("string"==typeof n){console.log("File content readable..");const e=new o.default(n,s,d).modifyEvents(),t=function(e){const t=e.lastIndexOf(".");return-1===t?e+" with reminders":e.substring(0,t)+" with reminders"+e.substring(t)}(i.name),r=new Blob([e],{type:"text/calendar"});!function(e,t){const n=document.getElementById("download-area"),r=document.getElementById("download-button");n&&r&&(r.href=t,r.download=e,setTimeout((()=>n.classList.add("show-download-area")),0),document.getElementById("work-button").disabled=!0)}(t,URL.createObjectURL(r))}},e.readAsText(i)}}document.addEventListener("DOMContentLoaded",(()=>{console.log("Loading the WebApp Version "+s.version+"..."),document.getElementById("footer-version").innerText=`Version: ${s.version}`;const e=document.getElementById("work-button");document.getElementById("ical-upload").addEventListener("change",(()=>{e.disabled=!1})),e.addEventListener("click",d)}))},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="0.1.5"}},t={};!function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}(519)})();
|
|
|
|
|
//# sourceMappingURL=bundle.js.map
|