Use bootstrap-modal for single-calc.
This commit is contained in:
@@ -9,45 +9,6 @@ const swalClasses = {
|
||||
htmlContainer: 'fs-5 text-center text-secondary-emphasis',
|
||||
};
|
||||
|
||||
function showSingleCalcDialog(btn) {
|
||||
Swal.fire({
|
||||
title: 'Einzel-Abfrage',
|
||||
input: 'text',
|
||||
inputLabel: 'Welcher Spieler soll abgefragt werden?\nDie Abfrage kann ein paar Sekunden dauern.',
|
||||
inputPlaceholder: 'Spieler-Name eingeben...',
|
||||
confirmButtonText: 'Berechnen',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: 'Abbrechen',
|
||||
customClass: swalClasses,
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
let promise = htmx.ajax('POST', '/score/' + result.value, {target: '#' + btn.id, swap: 'none'});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showSingleCalcResultDialog(xhr, reqPath) {
|
||||
let icon;
|
||||
switch (xhr.status) {
|
||||
case 200:
|
||||
icon = 'success';
|
||||
break;
|
||||
case 404:
|
||||
icon = 'warning';
|
||||
break;
|
||||
default:
|
||||
icon = 'error';
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Abfrage für "' + reqPath.replace("/score/", '') + '"',
|
||||
text: "Score: " + xhr.response,
|
||||
icon: icon,
|
||||
customClass: swalClasses
|
||||
});
|
||||
}
|
||||
|
||||
function showAdminActionExecutedDialog(xhr, method) {
|
||||
Swal.fire({
|
||||
title: 'Action executed',
|
||||
|
||||
Reference in New Issue
Block a user