35 lines
1.3 KiB
JavaScript
35 lines
1.3 KiB
JavaScript
// Debug script for dispute protocol builder
|
|
console.log("Debug script loaded");
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
console.log("DOM loaded in debug script");
|
|
|
|
// Check template system after a delay
|
|
setTimeout(() => {
|
|
// Check if templates are loaded
|
|
if (window.allTemplates) {
|
|
let templatesData;
|
|
try {
|
|
templatesData = typeof window.allTemplates === 'string' ?
|
|
JSON.parse(window.allTemplates) : window.allTemplates;
|
|
|
|
const templateCount = Object.keys(templatesData).length;
|
|
console.log(`✓ Templates loaded: ${templateCount} templates available`);
|
|
console.log("Template IDs:", Object.keys(templatesData));
|
|
} catch (error) {
|
|
console.error("✗ Error parsing templates:", error);
|
|
}
|
|
} else {
|
|
console.warn("✗ Templates not found in window.allTemplates");
|
|
}
|
|
|
|
// Check if template options are in the DOM
|
|
const templateOptions = document.querySelectorAll('.template-option');
|
|
console.log(`✓ Template options in DOM: ${templateOptions.length} found`);
|
|
|
|
// Check if form fields exist
|
|
const textareas = document.querySelectorAll('textarea');
|
|
console.log(`✓ Form fields: ${textareas.length} textareas found`);
|
|
}, 500);
|
|
});
|