25 lines
727 B
JavaScript
25 lines
727 B
JavaScript
document.addEventListener('DOMContentLoaded', function () {
|
|
const form = document.getElementById('pagehack-form');
|
|
const toastElement = document.getElementById('liveToast');
|
|
const toast = new bootstrap.Toast(toastElement);
|
|
|
|
form.addEventListener('submit', function (event) {
|
|
event.preventDefault();
|
|
|
|
const url = document.getElementById('page_url').value;
|
|
if (!url) {
|
|
alert('Please enter a URL.');
|
|
return;
|
|
}
|
|
|
|
// Show toast notification
|
|
toast.show();
|
|
|
|
// Submit the form after a brief delay to allow the toast to be seen
|
|
setTimeout(() => {
|
|
form.submit();
|
|
}, 500); // 0.5-second delay
|
|
|
|
});
|
|
});
|