Refactoring in progress, needs cleanup.

This commit is contained in:
2025-07-08 03:00:02 +00:00
parent ef01fde84a
commit 3135def2d7
15 changed files with 907 additions and 116 deletions
+35
View File
@@ -0,0 +1,35 @@
// Register page specific functionality
document.addEventListener('DOMContentLoaded', function() {
// Initialize the app
initializeApp();
// Registration form handler
const regForm = document.getElementById('registrationForm');
if (regForm) {
const regSubmitBtn = regForm.querySelector('button[type="submit"]');
regForm.addEventListener('submit', async (ev) => {
ev.preventDefault();
regSubmitBtn.disabled = true;
clearStatus('registerStatus');
const user_name = (new FormData(regForm)).get('username');
try {
showStatus('registerStatus', 'Starting registration...', 'info');
await register(user_name);
showStatus('registerStatus', `Registration successful for ${user_name}!`, 'success');
// Auto-login after successful registration
setTimeout(() => {
window.location.href = '/auth/profile';
}, 1500);
} catch (err) {
showStatus('registerStatus', `Registration failed: ${err.message}`, 'error');
} finally {
regSubmitBtn.disabled = false;
}
});
}
});