Spaces:
Running
Running
Update scripts/app.js
Browse files- scripts/app.js +8 -46
scripts/app.js
CHANGED
|
@@ -4,49 +4,11 @@ import { initUI } from './ui.js';
|
|
| 4 |
import { initChat } from './chat.js';
|
| 5 |
import { initVideo } from './video.js';
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
// Sanitize the message to prevent HTML injection issues
|
| 16 |
-
div.textContent = `> ${message}`;
|
| 17 |
-
logContainer.appendChild(div);
|
| 18 |
-
logContainer.parentElement.scrollTop = logContainer.parentElement.scrollHeight;
|
| 19 |
-
}
|
| 20 |
-
};
|
| 21 |
-
|
| 22 |
-
logToScreen('initializeApp() called. Starting initializations...');
|
| 23 |
-
|
| 24 |
-
// Test UI module
|
| 25 |
-
try {
|
| 26 |
-
logToScreen('Attempting to initialize UI...');
|
| 27 |
-
initUI();
|
| 28 |
-
logToScreen('SUCCESS: UI module initialized.');
|
| 29 |
-
} catch (e) {
|
| 30 |
-
logToScreen(`ERROR in initUI: ${e.stack}`);
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
-
// Test Chat module
|
| 34 |
-
try {
|
| 35 |
-
logToScreen('Attempting to initialize Chat...');
|
| 36 |
-
initChat();
|
| 37 |
-
logToScreen('SUCCESS: Chat module initialized.');
|
| 38 |
-
} catch (e) {
|
| 39 |
-
logToScreen(`ERROR in initChat: ${e.stack}`);
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
// Test Video module
|
| 43 |
-
try {
|
| 44 |
-
logToScreen('Attempting to initialize Video...');
|
| 45 |
-
initVideo();
|
| 46 |
-
logToScreen('SUCCESS: Video module initialized.');
|
| 47 |
-
} catch (e) {
|
| 48 |
-
logToScreen(`ERROR in initVideo: ${e.stack}`);
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
logToScreen('All initializations attempted.');
|
| 52 |
-
}
|
|
|
|
| 4 |
import { initChat } from './chat.js';
|
| 5 |
import { initVideo } from './video.js';
|
| 6 |
|
| 7 |
+
alert("Step 1: app.js is running!"); // <-- DEBUG ALERT
|
| 8 |
+
|
| 9 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 10 |
+
alert("Step 2: DOM is loaded. Initializing modules..."); // <-- DEBUG ALERT
|
| 11 |
+
initUI();
|
| 12 |
+
initChat();
|
| 13 |
+
initVideo();
|
| 14 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|