- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
58 lines
2.1 KiB
JavaScript
58 lines
2.1 KiB
JavaScript
import '../css/styles.css';
|
|
|
|
import { initApp } from './core/init.js';
|
|
import { Logger } from './core/logger.js';
|
|
import { CsrfAutoRefresh } from './modules/csrf-auto-refresh.js';
|
|
import { FormAutoSave } from './modules/form-autosave.js';
|
|
|
|
// PWA Service Worker temporarily disabled
|
|
// TODO: Re-enable after fixing build issues
|
|
|
|
document.addEventListener("DOMContentLoaded", async () => {
|
|
try {
|
|
console.log('🚀 Starting app initialization...');
|
|
await initApp();
|
|
console.log('✅ App initialized successfully!');
|
|
|
|
// Initialize CSRF Auto-Refresh for all forms
|
|
const csrfInstances = CsrfAutoRefresh.initializeAll();
|
|
console.log(`🔒 CSRF Auto-Refresh initialized for ${csrfInstances.length} forms`);
|
|
|
|
// Initialize Form Auto-Save for all forms
|
|
const autosaveInstances = FormAutoSave.initializeAll();
|
|
console.log(`💾 Form Auto-Save initialized for ${autosaveInstances.length} forms`);
|
|
|
|
// Debug info
|
|
setTimeout(() => {
|
|
console.log('📊 Debug Info:');
|
|
console.log('- Forms found:', document.querySelectorAll('form').length);
|
|
console.log('- Links found:', document.querySelectorAll('a[href^="/"]').length);
|
|
console.log('- SPA Router:', window.spaRouter ? 'Active' : 'Missing');
|
|
console.log('- Enhanced forms:', document.querySelectorAll('form[data-auto-enhanced]').length);
|
|
console.log('- CSRF protected forms:', document.querySelectorAll('input[name="_token"]').length);
|
|
}, 500);
|
|
} catch (error) {
|
|
console.error('❌ App initialization failed:', error);
|
|
console.error('Stack trace:', error.stack);
|
|
}
|
|
});
|
|
|
|
function isHtmlAttributeSupported(elementName, attribute) {
|
|
const element = document.createElement(elementName);
|
|
return attribute in element;
|
|
}
|
|
|
|
|
|
/*let closedAttr = document.getElementById('my-dialog');
|
|
if(closedAttr && !('closedby' in closedAttr)) {
|
|
alert('oh no');
|
|
}*/
|
|
|
|
/*
|
|
if (isHtmlAttributeSupported('dialog', 'closedby')) {
|
|
alert('Attribut wird unterstützt!');
|
|
} else {
|
|
alert('Nicht unterstützt!');
|
|
}
|
|
*/
|