update 2
This commit is contained in:
parent
b0a261b00c
commit
2a3b8e3c71
@ -13,6 +13,16 @@
|
|||||||
return new bootstrap.Dropdown(dropdownToggleEl)
|
return new bootstrap.Dropdown(dropdownToggleEl)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Override global alert
|
||||||
|
window.alert = function(message) {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Notification',
|
||||||
|
text: message,
|
||||||
|
icon: 'info',
|
||||||
|
confirmButtonColor: '#3085d6'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Global SweetAlert2 replacement for confirm()
|
// Global SweetAlert2 replacement for confirm()
|
||||||
const confirmLinks = document.querySelectorAll('a[onclick^="return confirm"]');
|
const confirmLinks = document.querySelectorAll('a[onclick^="return confirm"]');
|
||||||
|
|
||||||
@ -45,6 +55,33 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Intercept confirm in form onsubmit
|
||||||
|
const confirmForms = document.querySelectorAll('form[onsubmit^="return confirm"]');
|
||||||
|
confirmForms.forEach(form => {
|
||||||
|
const originalOnSubmit = form.getAttribute('onsubmit');
|
||||||
|
const match = originalOnSubmit.match(/confirm\(['"](.+?)['"]\)/);
|
||||||
|
const message = match ? match[1] : 'Are you sure?';
|
||||||
|
|
||||||
|
form.removeAttribute('onsubmit');
|
||||||
|
|
||||||
|
form.addEventListener('submit', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Are you sure?',
|
||||||
|
text: message,
|
||||||
|
icon: 'warning',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: '#d33',
|
||||||
|
cancelButtonColor: '#3085d6',
|
||||||
|
confirmButtonText: 'Yes, proceed!'
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
form.submit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
10
kitchen.php
10
kitchen.php
@ -462,5 +462,15 @@ setInterval(fetchOrders, 10000);
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script>
|
||||||
|
window.alert = function(message) {
|
||||||
|
Swal.fire({
|
||||||
|
title: "Notification",
|
||||||
|
text: message,
|
||||||
|
icon: "info",
|
||||||
|
confirmButtonColor: "var(--accent-color, #3085d6)"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -472,6 +472,17 @@ foreach ($variants_by_product as $pid => $vars) {
|
|||||||
}
|
}
|
||||||
.qty-val { width: 30px; text-align: center; font-weight: 600; }
|
.qty-val { width: 30px; text-align: center; font-weight: 600; }
|
||||||
</style>
|
</style>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
<script>
|
||||||
|
window.alert = function(message) {
|
||||||
|
Swal.fire({
|
||||||
|
title: "Notification",
|
||||||
|
text: message,
|
||||||
|
icon: "info",
|
||||||
|
confirmButtonColor: "var(--accent-color, #3085d6)"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
11
qorder.php
11
qorder.php
@ -364,6 +364,17 @@ foreach ($variants_raw as $v) {
|
|||||||
}
|
}
|
||||||
.qty-val { width: 30px; text-align: center; font-weight: 600; }
|
.qty-val { width: 30px; text-align: center; font-weight: 600; }
|
||||||
</style>
|
</style>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
<script>
|
||||||
|
window.alert = function(message) {
|
||||||
|
Swal.fire({
|
||||||
|
title: "Notification",
|
||||||
|
text: message,
|
||||||
|
icon: "info",
|
||||||
|
confirmButtonColor: "var(--accent-color, #3085d6)"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user