/** * Laila AI - Maintenance Notification System * Programmatically disables job creation during system updates (e.g., Google Updates) */ // Global flag to toggle maintenance mode // Set to true to enable maintenance mode across all integrated pages const Mainaticne = true; // Modal structure with modern glass-morphism design const maintenanceModalHTML = `

Temporary Maintenance

We are experiencing temporary issues with Video Generation due to a recent Google update. Our team is already working on a fix.

As a gesture of goodwill, we will increase your subscription expiry date once resolution is complete. Your payments are fully secured.

Status: Addressing Google Update Issues

Sorry for the inconvenience. We'll be back shortly!

`; // Execution logic if (typeof Mainaticne !== 'undefined' && Mainaticne === true) { window.addEventListener('load', () => { showMaintenanceNotice(); disableFormSubmissions(); }); } /** * Injects the maintenance modal into the page */ function showMaintenanceNotice() { // Prevent multiple injections if (document.getElementById('maintenance-overlay')) return; // Create a container and inject HTML const container = document.createElement('div'); container.innerHTML = maintenanceModalHTML; document.body.appendChild(container.firstElementChild); const overlay = document.getElementById('maintenance-overlay'); const modal = document.getElementById('maintenance-modal'); // Trigger animation setTimeout(() => { overlay.style.opacity = '1'; modal.style.transform = 'translateY(0)'; }, 100); } /** * Programmatically disables all job submission buttons and forms */ function disableFormSubmissions() { // List of known job submission buttons across various files const jobButtons = [ 'submitBtn', 'execute-btn', 'exportSubmitBtn', 'finalizeCreateBtn', 'generateAutoPromptsBtn', 'generateCharacterPromptsBtn', 'startAnalysisBtn' ]; jobButtons.forEach(btnId => { const btn = document.getElementById(btnId); if (btn) { btn.disabled = true; btn.innerHTML = ' Under Maintenance'; btn.style.background = '#94a3b8'; btn.style.cursor = 'not-allowed'; btn.style.transform = 'none'; btn.classList.add('grayscale'); // Re-render Lucide icons if available if (typeof lucide !== 'undefined') { lucide.createIcons(); } } }); // Prevent form submission if they bypass buttons (e.g., via Enter key) document.querySelectorAll('form').forEach(form => { form.addEventListener('submit', function(e) { if (typeof Mainaticne !== 'undefined' && Mainaticne === true) { // Only block if the form contains one of our target buttons or is for creation const hasTargetButton = Array.from(form.querySelectorAll('button, input[type="submit"]')).some(btn => jobButtons.includes(btn.id) || btn.type === 'submit' ); if (hasTargetButton) { e.preventDefault(); return false; } } }); }); }