Improved design
This commit is contained in:
@@ -14,14 +14,18 @@
|
|||||||
<option value="<%= index %>"><%= element %></option>
|
<option value="<%= index %>"><%= element %></option>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</select>
|
</select>
|
||||||
<button id="export-button" onclick="exportReport()">Export</button>
|
<button id="export-button" onclick="exportReport()">Exportieren</button>
|
||||||
|
</div>
|
||||||
|
<div class="ueberschrift">
|
||||||
|
<h4>Kalendereinträge</h4>
|
||||||
|
<button id="calendar-copy-button" onclick="copyToClipboard(calendarcalendarCopyButton, calendarTextarea)">Kopieren</button>
|
||||||
</div>
|
</div>
|
||||||
<h4>Kalendereinträge</h4>
|
|
||||||
<button id="calendar-copy-button" onclick="copyToClipboard(calendarcalendarCopyButton, calendarTextarea)">Copy</button>
|
|
||||||
<textarea id="calendar-textarea"></textarea>
|
<textarea id="calendar-textarea"></textarea>
|
||||||
|
|
||||||
<h4>Untis Einträge</h4>
|
<div class="ueberschrift">
|
||||||
<button id="untis-copy-button" onclick="copyToClipboard(untisCopyButton, untisTextarea)">Copy</button>
|
<h4>Untis Einträge</h4>
|
||||||
|
<button id="untis-copy-button" onclick="copyToClipboard(untisCopyButton, untisTextarea)">Kopieren</button>
|
||||||
|
</div>
|
||||||
<textarea id="untis-textarea"></textarea>
|
<textarea id="untis-textarea"></textarea>
|
||||||
|
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
|
|||||||
@@ -11,27 +11,27 @@ let loadingInterval;
|
|||||||
|
|
||||||
function copyToClipboard(button, textarea) {
|
function copyToClipboard(button, textarea) {
|
||||||
navigator.clipboard.writeText(textarea.value).then(() => {
|
navigator.clipboard.writeText(textarea.value).then(() => {
|
||||||
button.innerText = 'Copied!';
|
button.innerText = 'Kopiert!';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
button.innerText = 'Copy';
|
button.innerText = 'Kopieren';
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
button.innerText = 'Error!';
|
button.innerText = 'Error!';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
button.innerText = 'Copy';
|
button.innerText = 'Kopieren';
|
||||||
}, 2000);
|
}, 2000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loading() {
|
function loading() {
|
||||||
exportButton.disabled = true;
|
exportButton.disabled = true;
|
||||||
calendarTextarea.value = 'Loading';
|
calendarTextarea.value = 'Wird geladen';
|
||||||
untisTextarea.value = '';
|
untisTextarea.value = '';
|
||||||
loadingInterval = setInterval(() => {
|
loadingInterval = setInterval(() => {
|
||||||
if (calendarTextarea.value != 'Loading...') {
|
if (calendarTextarea.value != 'Wird geladen...') {
|
||||||
calendarTextarea.value += '.';
|
calendarTextarea.value += '.';
|
||||||
} else {
|
} else {
|
||||||
calendarTextarea.value = 'Loading';
|
calendarTextarea.value = 'Wird geladen';
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
@@ -52,8 +52,8 @@ function exportReport() {
|
|||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response.text();
|
return response.text();
|
||||||
} else {
|
} else {
|
||||||
calendarTextarea.value = 'Error while fetching report';
|
calendarTextarea.value = 'Error während des Abrufs';
|
||||||
throw new Error('Error while fetching report');
|
throw new Error('Error während des Abrufs');
|
||||||
}
|
}
|
||||||
}).then(text => {
|
}).then(text => {
|
||||||
loaded();
|
loaded();
|
||||||
@@ -70,7 +70,7 @@ function exportReport() {
|
|||||||
untisTextarea.style.height = untisTextarea.scrollHeight + "px";
|
untisTextarea.style.height = untisTextarea.scrollHeight + "px";
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
loaded();
|
loaded();
|
||||||
calendarTextarea.value = 'Error while fetching report';
|
calendarTextarea.value = 'Error während des Abrufs';
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,6 @@ h1 {
|
|||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: 20px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.selector {
|
.selector {
|
||||||
@@ -59,4 +57,11 @@ textarea {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
border: none;
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ueberschrift {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user