Compare commits

...

2 Commits

2 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,7 @@
<form id="merge-form">
<div id="calendars">
<div class="calendar">
<input type="text" id="link-group-name-0" placeholder="Link Group Name">
<input type="text" id="prefix-0" placeholder="Prefix">
<input type="checkbox" id="override-0">
<label for="override-0">Override</label>

View File

@ -9,6 +9,7 @@ const form = document.getElementById('merge-form');
const newCalendar = document.createElement('div');
newCalendar.className = 'calendar';
newCalendar.innerHTML = `
<input type="text" id="link-group-name-${calendarIndex}" placeholder="Link Group Name">
<input type="text" id="prefix-${calendarIndex}" placeholder="Prefix">
<input type="checkbox" id="override-${calendarIndex}">
<label for="override-${calendarIndex}">Override</label>
@ -22,6 +23,7 @@ const form = document.getElementById('merge-form');
event.preventDefault();
const calendarsData = [];
for (let i = 0; i < calendarIndex; i++) {
const linkGroupName = document.getElementById(`link-group-name-${i}`).value;
const prefix = document.getElementById(`prefix-${i}`).value;
const override = document.getElementById(`override-${i}`).checked;
const url = document.getElementById(`url-${i}`).value;
@ -42,7 +44,7 @@ const form = document.getElementById('merge-form');
console.error(error);
result.innerHTML = 'Error merging calendars';
});
// Send the input data to the server
fetch('/add-links', {
method: 'POST',