diff --git a/public/js/complete-app.js b/public/js/complete-app.js
index 37868a0..e2096b0 100644
--- a/public/js/complete-app.js
+++ b/public/js/complete-app.js
@@ -420,10 +420,9 @@ function renderNoteTodos(todos) {
const item = document.createElement('div');
item.className = 'todo-item';
item.innerHTML = `
-
+
${escapeHtml(todo.text)}
-
+
`;
if (todo.completed) item.classList.add('completed');
list.appendChild(item);
@@ -573,10 +572,9 @@ function renderTodos() {
const item = document.createElement('div');
item.className = 'todo-item' + (todo.completed ? ' completed' : '');
item.innerHTML = `
-
+
${escapeHtml(todo.text)}
-
+
`;
todoList.appendChild(item);
});
@@ -599,17 +597,16 @@ async function addTodo() {
}
}
-// Exposer globalement pour les event handlers inline
-window.toggleTodo = async function(id, completed) {
+async function toggleTodo(id, completed) {
try {
await api.put(`/api/todos/${id}`, { completed });
await loadTodos();
} catch (error) {
console.error('Erreur toggle todo:', error);
}
-};
+}
-window.deleteTodo = async function(id) {
+async function deleteTodo(id) {
const confirmed = await confirmDialog.show({
icon: '🗑️',
title: 'Supprimer cette tâche',
@@ -625,7 +622,7 @@ window.deleteTodo = async function(id) {
} catch (error) {
console.error('Erreur suppression todo:', error);
}
-};
+}
function setTodoFilter(filter) {
state.filter = filter;
@@ -696,7 +693,7 @@ function renderUsersTable(users) {
${new Date(user.created_at).toLocaleDateString('fr-FR')} |
${user.id !== state.user.id ? `
- |