Löschen-Funktion hinzugefügt
This commit is contained in:
7
js/bootstrap.bundle.min.js
vendored
Normal file
7
js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
js/bootstrap.bundle.min.js.map
Normal file
1
js/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
7
js/bootstrap.min.js
vendored
7
js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
28
js/plweb.js
28
js/plweb.js
@@ -46,7 +46,7 @@ function result_color(result) {
|
||||
|
||||
function parse_and_show_pluslife_result(overall_result, channel_results){
|
||||
$("#testresult").append(result_text(overall_result));
|
||||
if (result_text(overall_result) == "ungueltig")
|
||||
if (result_text(overall_result) == "Ungültig")
|
||||
$("#testresult").addClass("ungueltig");
|
||||
else
|
||||
$("#testresult").addClass(result_text(overall_result).toLowerCase());
|
||||
@@ -107,6 +107,21 @@ function update_chart(timestamp, overall_result, result_channels, sampledata){
|
||||
chart.update();
|
||||
}
|
||||
|
||||
function delete_test() {
|
||||
var id = new URLSearchParams(window.location.search).get('id');
|
||||
|
||||
$.ajax({
|
||||
url: "delete.php?id=" + id,
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
window.location.href="index.php";
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
show_error("Fehler: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function show_error(text) {
|
||||
console.log(text);
|
||||
@@ -123,5 +138,16 @@ function show_error(text) {
|
||||
} else {
|
||||
show_error("Konnte Testdaten nicht laden");
|
||||
}
|
||||
|
||||
const deleteModal = new bootstrap.Modal('#deleteModal', { keyboard: false, backdrop: 'static' });
|
||||
$("#btn-delete-yes").click(function () {
|
||||
delete_test();
|
||||
deleteModal.hide();
|
||||
});
|
||||
$("#btn-delete").click(function () {
|
||||
deleteModal.show();
|
||||
});
|
||||
// ARIA Warnung wg. aria-hidden umgehen:
|
||||
$('#deleteModal').on('hide.bs.modal', () => { document.activeElement.blur(); });
|
||||
})();
|
||||
|
||||
|
Reference in New Issue
Block a user