email and fix
This commit is contained in:
38
public/main.js
Normal file
38
public/main.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// main.js - Главный файл инициализации
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
checkAuth();
|
||||
setupEventListeners();
|
||||
|
||||
// Устанавливаем дату по умолчанию для создания задачи (через 3 дня)
|
||||
const defaultDate = new Date();
|
||||
defaultDate.setDate(defaultDate.getDate() + 3);
|
||||
document.getElementById('due-date').value = defaultDate.toISOString().substring(0, 16);
|
||||
|
||||
// По умолчанию показываем секцию задач
|
||||
showSection('tasks');
|
||||
});
|
||||
|
||||
function setupEventListeners() {
|
||||
// Форма входа
|
||||
document.getElementById('login-form').addEventListener('submit', login);
|
||||
|
||||
// Формы задач
|
||||
document.getElementById('create-task-form').addEventListener('submit', createTask);
|
||||
document.getElementById('edit-task-form').addEventListener('submit', updateTask);
|
||||
document.getElementById('copy-task-form').addEventListener('submit', copyTask);
|
||||
document.getElementById('edit-assignment-form').addEventListener('submit', updateAssignment);
|
||||
document.getElementById('rework-task-form').addEventListener('submit', sendForRework);
|
||||
|
||||
// Файлы
|
||||
document.getElementById('files').addEventListener('change', updateFileList);
|
||||
document.getElementById('edit-files').addEventListener('change', updateEditFileList);
|
||||
|
||||
// Настройки уведомлений
|
||||
const notificationForm = document.getElementById('notification-settings-form');
|
||||
if (notificationForm) {
|
||||
notificationForm.addEventListener('submit', saveNotificationSettings);
|
||||
}
|
||||
|
||||
// Инициализация загрузки файлов
|
||||
initializeFileUploads();
|
||||
}
|
||||
Reference in New Issue
Block a user