🧹 Nettoyage interface et correction erreurs JavaScript
- Suppression emojis superflus dans interface utilisateur - Correction erreurs d'encodage UTF-8 (caractères corrompus) - Fix erreur JavaScript : togglePreview() déplacé dans la classe ConceptionAssistant - Fix erreur JavaScript : togglePanel accessible globalement avec window.togglePanel - Interface plus sobre et professionnelle 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
39a2276c66
commit
563932a733
@ -502,7 +502,7 @@ button.success:hover {
|
||||
background: #229954;
|
||||
}
|
||||
|
||||
/* Input file personnalis<EFBFBD> */
|
||||
/* Input file personnalisé */
|
||||
.file-input-label {
|
||||
padding: 0.6rem 1.2rem;
|
||||
border-radius: var(--border-radius);
|
||||
@ -571,7 +571,7 @@ section h2 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Table des mati<EFBFBD>res */
|
||||
/* Table des matières */
|
||||
#table-of-contents {
|
||||
/* Comportement normal de scroll */
|
||||
}
|
||||
@ -613,7 +613,7 @@ section h2 {
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
/* Zone d'<EFBFBD>criture */
|
||||
/* Zone d'écriture */
|
||||
#design-journal {
|
||||
min-height: 600px;
|
||||
}
|
||||
@ -890,7 +890,7 @@ footer a:hover {
|
||||
}
|
||||
}
|
||||
|
||||
/* Scrollbars personnalis<EFBFBD>es */
|
||||
/* Scrollbars personnalisées */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
|
128
assets/js/app.js
128
assets/js/app.js
@ -221,7 +221,7 @@ class ConceptionAssistant {
|
||||
this.currentJournalId = result.data.id;
|
||||
}
|
||||
|
||||
statusEl.textContent = '✅ Sauvegardé';
|
||||
statusEl.textContent = 'Sauvegardé';
|
||||
this.showNotification('Journal sauvegardé avec succès', 'success');
|
||||
setTimeout(() => statusEl.textContent = '', 3000);
|
||||
} else {
|
||||
@ -229,7 +229,7 @@ class ConceptionAssistant {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Erreur:', error);
|
||||
statusEl.textContent = '❌ Erreur';
|
||||
statusEl.textContent = 'Erreur';
|
||||
this.showNotification('Erreur lors de la sauvegarde: ' + error.message, 'error');
|
||||
setTimeout(() => statusEl.textContent = '', 3000);
|
||||
} finally {
|
||||
@ -550,7 +550,7 @@ class ConceptionAssistant {
|
||||
|
||||
// Vérifier les conditions selon l'action
|
||||
if (action === 'rephrase' && !selection) {
|
||||
this.showAIFeedback('⚠️ Veuillez sélectionner du texte à reformuler');
|
||||
this.showAIFeedback('Veuillez sélectionner du texte à reformuler');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -591,7 +591,7 @@ class ConceptionAssistant {
|
||||
};
|
||||
|
||||
this.showAIFeedback(`
|
||||
<strong>✨ Reformulation</strong><br><br>
|
||||
<strong>Reformulation</strong><br><br>
|
||||
|
||||
<div style="background: var(--background-color); padding: 1rem; border-radius: 8px; margin: 0.5rem 0;">
|
||||
<strong>Texte original :</strong><br>
|
||||
@ -604,10 +604,10 @@ class ConceptionAssistant {
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<button id="validate-rephrase" class="btn success" style="margin-right: 0.5rem;">
|
||||
✅ Appliquer la reformulation
|
||||
Appliquer la reformulation
|
||||
</button>
|
||||
<button id="cancel-rephrase" class="btn secondary">
|
||||
❌ Annuler
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
`);
|
||||
@ -619,17 +619,17 @@ class ConceptionAssistant {
|
||||
|
||||
case 'inconsistencies':
|
||||
result = await this.callAI('/api/ai/check-inconsistencies', { content: contentToUse });
|
||||
this.showAIFeedback(`<strong>🔍 Analyse des incohérences</strong><br><br>${this.formatAIResponse(result.analysis)}`);
|
||||
this.showAIFeedback(`<strong>Analyse des incohérences</strong><br><br>${this.formatAIResponse(result.analysis)}`);
|
||||
break;
|
||||
|
||||
case 'duplications':
|
||||
result = await this.callAI('/api/ai/check-duplications', { content: contentToUse });
|
||||
this.showAIFeedback(`<strong>📋 Vérification des doublons</strong><br><br>${this.formatAIResponse(result.analysis)}`);
|
||||
this.showAIFeedback(`<strong>Vérification des doublons</strong><br><br>${this.formatAIResponse(result.analysis)}`);
|
||||
break;
|
||||
|
||||
case 'advice':
|
||||
result = await this.callAI('/api/ai/give-advice', { content: contentToUse, domain: 'conception' });
|
||||
this.showAIFeedback(`<strong>💡 Conseils d'amélioration</strong><br><br>${this.formatAIResponse(result.advice)}`);
|
||||
this.showAIFeedback(`<strong>Conseils d'amélioration</strong><br><br>${this.formatAIResponse(result.advice)}`);
|
||||
break;
|
||||
|
||||
case 'liberty':
|
||||
@ -644,19 +644,19 @@ class ConceptionAssistant {
|
||||
this.saveState();
|
||||
}
|
||||
|
||||
let libertyHTML = `<strong>🚀 Mode Liberté Intelligent (${result.iterations} itérations)</strong><br><br>`;
|
||||
let libertyHTML = `<strong>Mode Liberté Intelligent (${result.iterations} itérations)</strong><br><br>`;
|
||||
|
||||
// Vérifier si l'IA s'est arrêtée prématurément
|
||||
const lastIteration = result.results[result.results.length - 1];
|
||||
if (lastIteration && lastIteration.stopped) {
|
||||
libertyHTML += `<p>🛑 Analyse terminée après ${result.iterations} itérations - Aucune amélioration évidente supplémentaire détectée.</p>`;
|
||||
libertyHTML += `<p>Analyse terminée après ${result.iterations} itérations - Aucune amélioration évidente supplémentaire détectée.</p>`;
|
||||
} else {
|
||||
libertyHTML += `<p>✅ Les ${result.iterations} itérations d'amélioration ont été automatiquement appliquées au document.</p>`;
|
||||
libertyHTML += `<p>Les ${result.iterations} itérations d'amélioration ont été automatiquement appliquées au document.</p>`;
|
||||
}
|
||||
|
||||
result.results.forEach(iteration => {
|
||||
const borderColor = iteration.stopped ? 'var(--warning-color)' : 'var(--success-color)';
|
||||
const icon = iteration.stopped ? '🛑' : '🎯';
|
||||
const icon = iteration.stopped ? 'STOP' : 'OK';
|
||||
|
||||
libertyHTML += `
|
||||
<div style="background: var(--background-color); padding: 1rem; border-radius: 8px; margin: 0.5rem 0; border-left: 4px solid ${borderColor};">
|
||||
@ -670,7 +670,7 @@ class ConceptionAssistant {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Erreur IA:', error);
|
||||
this.showAIFeedback(`<strong>❌ Erreur</strong><br><br>Une erreur s'est produite : ${error.message}<br><br>Vérifiez votre connexion et la configuration de l'API.`);
|
||||
this.showAIFeedback(`<strong>Erreur</strong><br><br>Une erreur s'est produite : ${error.message}<br><br>Vérifiez votre connexion et la configuration de l'API.`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -800,7 +800,7 @@ class ConceptionAssistant {
|
||||
const feedback = document.getElementById('ai-assistant-feedback');
|
||||
feedback.innerHTML = `
|
||||
<div class="feedback-message" style="text-align: center; color: var(--text-light);">
|
||||
<strong>🎯 Assistant IA prêt</strong><br>
|
||||
<strong>Assistant IA prêt</strong><br>
|
||||
Sélectionnez du texte dans l'éditeur et cliquez sur une action pour commencer.
|
||||
</div>
|
||||
`;
|
||||
@ -819,6 +819,50 @@ class ConceptionAssistant {
|
||||
setTimeout(() => document.body.removeChild(notification), 300);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
togglePreview() {
|
||||
const previewBtn = document.getElementById('preview-toggle');
|
||||
|
||||
if (!this.isPreviewMode) {
|
||||
// Passer en mode prévisualisation
|
||||
this.originalContent = this.editor.innerHTML;
|
||||
const markdownContent = this.editor.innerText;
|
||||
|
||||
// Convertir le Markdown en HTML joliment formaté
|
||||
const previewHTML = this.parseMarkdown(markdownContent);
|
||||
|
||||
// Désactiver l'édition et appliquer le style preview
|
||||
this.editor.contentEditable = false;
|
||||
this.editor.innerHTML = `<div style="max-width: 800px; margin: 0 auto; padding: 2rem; line-height: 1.8; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">${previewHTML}</div>`;
|
||||
this.editor.style.background = 'var(--background-color)';
|
||||
this.editor.style.border = '1px solid var(--border-color)';
|
||||
this.editor.style.borderRadius = '8px';
|
||||
|
||||
// Changer le bouton
|
||||
previewBtn.innerHTML = 'Éditer';
|
||||
previewBtn.classList.remove('primary');
|
||||
previewBtn.classList.add('secondary');
|
||||
|
||||
this.isPreviewMode = true;
|
||||
this.showNotification('Mode prévisualisation activé', 'success');
|
||||
|
||||
} else {
|
||||
// Revenir en mode édition
|
||||
this.editor.contentEditable = true;
|
||||
this.editor.innerHTML = this.originalContent;
|
||||
this.editor.style.background = '';
|
||||
this.editor.style.border = '';
|
||||
this.editor.style.borderRadius = '';
|
||||
|
||||
// Changer le bouton
|
||||
previewBtn.innerHTML = 'Visualiser';
|
||||
previewBtn.classList.remove('secondary');
|
||||
previewBtn.classList.add('primary');
|
||||
|
||||
this.isPreviewMode = false;
|
||||
this.showNotification('Mode édition activé', 'success');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion des panneaux latéraux
|
||||
@ -900,9 +944,9 @@ function initializeTemplateForm() {
|
||||
levelSelect.disabled = false;
|
||||
levelSelect.innerHTML = `
|
||||
<option value="">-- Choisir le niveau --</option>
|
||||
<option value="simple">📄 Simple</option>
|
||||
<option value="detaille">📋 Détaillé</option>
|
||||
<option value="complet">📚 Complet</option>
|
||||
<option value="simple">Simple</option>
|
||||
<option value="detaille">Détaillé</option>
|
||||
<option value="complet">Complet</option>
|
||||
`;
|
||||
|
||||
loadTemplateBtn.disabled = true;
|
||||
@ -961,49 +1005,7 @@ function initializeTemplateForm() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
togglePreview() {
|
||||
const previewBtn = document.getElementById('preview-toggle');
|
||||
|
||||
if (!this.isPreviewMode) {
|
||||
// Passer en mode prévisualisation
|
||||
this.originalContent = this.editor.innerHTML;
|
||||
const markdownContent = this.editor.innerText;
|
||||
|
||||
// Convertir le Markdown en HTML joliment formaté
|
||||
const previewHTML = this.parseMarkdown(markdownContent);
|
||||
|
||||
// Désactiver l'édition et appliquer le style preview
|
||||
this.editor.contentEditable = false;
|
||||
this.editor.innerHTML = `<div style="max-width: 800px; margin: 0 auto; padding: 2rem; line-height: 1.8; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">${previewHTML}</div>`;
|
||||
this.editor.style.background = 'var(--background-color)';
|
||||
this.editor.style.border = '1px solid var(--border-color)';
|
||||
this.editor.style.borderRadius = '8px';
|
||||
|
||||
// Changer le bouton
|
||||
previewBtn.innerHTML = '✏️ Éditer';
|
||||
previewBtn.classList.remove('primary');
|
||||
previewBtn.classList.add('secondary');
|
||||
|
||||
this.isPreviewMode = true;
|
||||
this.showNotification('Mode prévisualisation activé', 'success');
|
||||
|
||||
} else {
|
||||
// Revenir en mode édition
|
||||
this.editor.contentEditable = true;
|
||||
this.editor.innerHTML = this.originalContent;
|
||||
this.editor.style.background = '';
|
||||
this.editor.style.border = '';
|
||||
this.editor.style.borderRadius = '';
|
||||
|
||||
// Changer le bouton
|
||||
previewBtn.innerHTML = '👁️ Visualiser';
|
||||
previewBtn.classList.remove('secondary');
|
||||
previewBtn.classList.add('primary');
|
||||
|
||||
this.isPreviewMode = false;
|
||||
this.showNotification('Mode édition activé', 'success');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// S'assurer que togglePanel est accessible globalement
|
||||
window.togglePanel = togglePanel;
|
@ -15,19 +15,19 @@ function getLeftPanel() {
|
||||
<span class="arrow">▶</span>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<h3 class="panel-header">⚙️ Templates de Projet</h3>
|
||||
<h3 class="panel-header">Templates de Projet</h3>
|
||||
|
||||
<div class="template-form">
|
||||
<div class="form-group">
|
||||
<label for="domain-select">Domaine :</label>
|
||||
<select id="domain-select" title="Choisir le domaine">
|
||||
<option value="">-- Sélectionner un domaine --</option>
|
||||
<option value="recherche">🔬 Recherche</option>
|
||||
<option value="math">📐 Mathématiques</option>
|
||||
<option value="informatique">💻 Informatique</option>
|
||||
<option value="ingenierie">⚙️ Ingénierie</option>
|
||||
<option value="business">💼 Business</option>
|
||||
<option value="design">🎨 Design</option>
|
||||
<option value="recherche">Recherche</option>
|
||||
<option value="math">Mathématiques</option>
|
||||
<option value="informatique">Informatique</option>
|
||||
<option value="ingenierie">Ingénierie</option>
|
||||
<option value="business">Business</option>
|
||||
<option value="design">Design</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -35,15 +35,15 @@ function getLeftPanel() {
|
||||
<label for="level-select">Niveau de détail :</label>
|
||||
<select id="level-select" title="Niveau de détail" disabled>
|
||||
<option value="">-- Choisir d'abord un domaine --</option>
|
||||
<option value="simple">📄 Simple</option>
|
||||
<option value="detaille">📋 Détaillé</option>
|
||||
<option value="complet">📚 Complet</option>
|
||||
<option value="simple">Simple</option>
|
||||
<option value="detaille">Détaillé</option>
|
||||
<option value="complet">Complet</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button id="load-template" class="btn success" title="Charger le template" disabled>
|
||||
✨ Charger le template
|
||||
Charger le template
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,13 +59,13 @@ function getRightPanel() {
|
||||
<span class="arrow">◀</span>
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<h3 class="panel-header">🛠️ Outils</h3>
|
||||
<h3 class="panel-header">Outils</h3>
|
||||
|
||||
<div class="nav-section">
|
||||
<h4>Apparence</h4>
|
||||
<div class="nav-buttons">
|
||||
<button class="nav-btn" id="theme-toggle" title="Basculer mode sombre">
|
||||
<span class="icon">🌓</span>
|
||||
<span class="icon">☽</span>
|
||||
<span>Basculer le thème</span>
|
||||
</button>
|
||||
</div>
|
||||
@ -75,7 +75,7 @@ function getRightPanel() {
|
||||
<h4>Export</h4>
|
||||
<div class="nav-buttons">
|
||||
<button class="nav-btn" id="export-md" title="Exporter en Markdown">
|
||||
<span class="icon">📝</span>
|
||||
<span class="icon">↓</span>
|
||||
<span>Exporter en Markdown</span>
|
||||
</button>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user