🧹 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;
|
background: #229954;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Input file personnalis<EFBFBD> */
|
/* Input file personnalisé */
|
||||||
.file-input-label {
|
.file-input-label {
|
||||||
padding: 0.6rem 1.2rem;
|
padding: 0.6rem 1.2rem;
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
@ -571,7 +571,7 @@ section h2 {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Table des mati<EFBFBD>res */
|
/* Table des matières */
|
||||||
#table-of-contents {
|
#table-of-contents {
|
||||||
/* Comportement normal de scroll */
|
/* Comportement normal de scroll */
|
||||||
}
|
}
|
||||||
@ -613,7 +613,7 @@ section h2 {
|
|||||||
color: var(--text-light);
|
color: var(--text-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Zone d'<EFBFBD>criture */
|
/* Zone d'écriture */
|
||||||
#design-journal {
|
#design-journal {
|
||||||
min-height: 600px;
|
min-height: 600px;
|
||||||
}
|
}
|
||||||
@ -890,7 +890,7 @@ footer a:hover {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scrollbars personnalis<EFBFBD>es */
|
/* Scrollbars personnalisées */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
|
128
assets/js/app.js
128
assets/js/app.js
@ -221,7 +221,7 @@ class ConceptionAssistant {
|
|||||||
this.currentJournalId = result.data.id;
|
this.currentJournalId = result.data.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
statusEl.textContent = '✅ Sauvegardé';
|
statusEl.textContent = 'Sauvegardé';
|
||||||
this.showNotification('Journal sauvegardé avec succès', 'success');
|
this.showNotification('Journal sauvegardé avec succès', 'success');
|
||||||
setTimeout(() => statusEl.textContent = '', 3000);
|
setTimeout(() => statusEl.textContent = '', 3000);
|
||||||
} else {
|
} else {
|
||||||
@ -229,7 +229,7 @@ class ConceptionAssistant {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Erreur:', error);
|
console.error('Erreur:', error);
|
||||||
statusEl.textContent = '❌ Erreur';
|
statusEl.textContent = 'Erreur';
|
||||||
this.showNotification('Erreur lors de la sauvegarde: ' + error.message, 'error');
|
this.showNotification('Erreur lors de la sauvegarde: ' + error.message, 'error');
|
||||||
setTimeout(() => statusEl.textContent = '', 3000);
|
setTimeout(() => statusEl.textContent = '', 3000);
|
||||||
} finally {
|
} finally {
|
||||||
@ -550,7 +550,7 @@ class ConceptionAssistant {
|
|||||||
|
|
||||||
// Vérifier les conditions selon l'action
|
// Vérifier les conditions selon l'action
|
||||||
if (action === 'rephrase' && !selection) {
|
if (action === 'rephrase' && !selection) {
|
||||||
this.showAIFeedback('⚠️ Veuillez sélectionner du texte à reformuler');
|
this.showAIFeedback('Veuillez sélectionner du texte à reformuler');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ class ConceptionAssistant {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.showAIFeedback(`
|
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;">
|
<div style="background: var(--background-color); padding: 1rem; border-radius: 8px; margin: 0.5rem 0;">
|
||||||
<strong>Texte original :</strong><br>
|
<strong>Texte original :</strong><br>
|
||||||
@ -604,10 +604,10 @@ class ConceptionAssistant {
|
|||||||
</div>
|
</div>
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<button id="validate-rephrase" class="btn success" style="margin-right: 0.5rem;">
|
<button id="validate-rephrase" class="btn success" style="margin-right: 0.5rem;">
|
||||||
✅ Appliquer la reformulation
|
Appliquer la reformulation
|
||||||
</button>
|
</button>
|
||||||
<button id="cancel-rephrase" class="btn secondary">
|
<button id="cancel-rephrase" class="btn secondary">
|
||||||
❌ Annuler
|
Annuler
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
@ -619,17 +619,17 @@ class ConceptionAssistant {
|
|||||||
|
|
||||||
case 'inconsistencies':
|
case 'inconsistencies':
|
||||||
result = await this.callAI('/api/ai/check-inconsistencies', { content: contentToUse });
|
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;
|
break;
|
||||||
|
|
||||||
case 'duplications':
|
case 'duplications':
|
||||||
result = await this.callAI('/api/ai/check-duplications', { content: contentToUse });
|
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;
|
break;
|
||||||
|
|
||||||
case 'advice':
|
case 'advice':
|
||||||
result = await this.callAI('/api/ai/give-advice', { content: contentToUse, domain: 'conception' });
|
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;
|
break;
|
||||||
|
|
||||||
case 'liberty':
|
case 'liberty':
|
||||||
@ -644,19 +644,19 @@ class ConceptionAssistant {
|
|||||||
this.saveState();
|
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
|
// Vérifier si l'IA s'est arrêtée prématurément
|
||||||
const lastIteration = result.results[result.results.length - 1];
|
const lastIteration = result.results[result.results.length - 1];
|
||||||
if (lastIteration && lastIteration.stopped) {
|
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 {
|
} 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 => {
|
result.results.forEach(iteration => {
|
||||||
const borderColor = iteration.stopped ? 'var(--warning-color)' : 'var(--success-color)';
|
const borderColor = iteration.stopped ? 'var(--warning-color)' : 'var(--success-color)';
|
||||||
const icon = iteration.stopped ? '🛑' : '🎯';
|
const icon = iteration.stopped ? 'STOP' : 'OK';
|
||||||
|
|
||||||
libertyHTML += `
|
libertyHTML += `
|
||||||
<div style="background: var(--background-color); padding: 1rem; border-radius: 8px; margin: 0.5rem 0; border-left: 4px solid ${borderColor};">
|
<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) {
|
} catch (error) {
|
||||||
console.error('Erreur IA:', 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');
|
const feedback = document.getElementById('ai-assistant-feedback');
|
||||||
feedback.innerHTML = `
|
feedback.innerHTML = `
|
||||||
<div class="feedback-message" style="text-align: center; color: var(--text-light);">
|
<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.
|
Sélectionnez du texte dans l'éditeur et cliquez sur une action pour commencer.
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@ -819,6 +819,50 @@ class ConceptionAssistant {
|
|||||||
setTimeout(() => document.body.removeChild(notification), 300);
|
setTimeout(() => document.body.removeChild(notification), 300);
|
||||||
}, 3000);
|
}, 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
|
// Gestion des panneaux latéraux
|
||||||
@ -900,9 +944,9 @@ function initializeTemplateForm() {
|
|||||||
levelSelect.disabled = false;
|
levelSelect.disabled = false;
|
||||||
levelSelect.innerHTML = `
|
levelSelect.innerHTML = `
|
||||||
<option value="">-- Choisir le niveau --</option>
|
<option value="">-- Choisir le niveau --</option>
|
||||||
<option value="simple">📄 Simple</option>
|
<option value="simple">Simple</option>
|
||||||
<option value="detaille">📋 Détaillé</option>
|
<option value="detaille">Détaillé</option>
|
||||||
<option value="complet">📚 Complet</option>
|
<option value="complet">Complet</option>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
loadTemplateBtn.disabled = true;
|
loadTemplateBtn.disabled = true;
|
||||||
@ -961,49 +1005,7 @@ function initializeTemplateForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
togglePreview() {
|
// S'assurer que togglePanel est accessible globalement
|
||||||
const previewBtn = document.getElementById('preview-toggle');
|
window.togglePanel = togglePanel;
|
||||||
|
|
||||||
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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -15,19 +15,19 @@ function getLeftPanel() {
|
|||||||
<span class="arrow">▶</span>
|
<span class="arrow">▶</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-content">
|
<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="template-form">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="domain-select">Domaine :</label>
|
<label for="domain-select">Domaine :</label>
|
||||||
<select id="domain-select" title="Choisir le domaine">
|
<select id="domain-select" title="Choisir le domaine">
|
||||||
<option value="">-- Sélectionner un domaine --</option>
|
<option value="">-- Sélectionner un domaine --</option>
|
||||||
<option value="recherche">🔬 Recherche</option>
|
<option value="recherche">Recherche</option>
|
||||||
<option value="math">📐 Mathématiques</option>
|
<option value="math">Mathématiques</option>
|
||||||
<option value="informatique">💻 Informatique</option>
|
<option value="informatique">Informatique</option>
|
||||||
<option value="ingenierie">⚙️ Ingénierie</option>
|
<option value="ingenierie">Ingénierie</option>
|
||||||
<option value="business">💼 Business</option>
|
<option value="business">Business</option>
|
||||||
<option value="design">🎨 Design</option>
|
<option value="design">Design</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -35,15 +35,15 @@ function getLeftPanel() {
|
|||||||
<label for="level-select">Niveau de détail :</label>
|
<label for="level-select">Niveau de détail :</label>
|
||||||
<select id="level-select" title="Niveau de détail" disabled>
|
<select id="level-select" title="Niveau de détail" disabled>
|
||||||
<option value="">-- Choisir d'abord un domaine --</option>
|
<option value="">-- Choisir d'abord un domaine --</option>
|
||||||
<option value="simple">📄 Simple</option>
|
<option value="simple">Simple</option>
|
||||||
<option value="detaille">📋 Détaillé</option>
|
<option value="detaille">Détaillé</option>
|
||||||
<option value="complet">📚 Complet</option>
|
<option value="complet">Complet</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button id="load-template" class="btn success" title="Charger le template" disabled>
|
<button id="load-template" class="btn success" title="Charger le template" disabled>
|
||||||
✨ Charger le template
|
Charger le template
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -59,13 +59,13 @@ function getRightPanel() {
|
|||||||
<span class="arrow">◀</span>
|
<span class="arrow">◀</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-content">
|
<div class="panel-content">
|
||||||
<h3 class="panel-header">🛠️ Outils</h3>
|
<h3 class="panel-header">Outils</h3>
|
||||||
|
|
||||||
<div class="nav-section">
|
<div class="nav-section">
|
||||||
<h4>Apparence</h4>
|
<h4>Apparence</h4>
|
||||||
<div class="nav-buttons">
|
<div class="nav-buttons">
|
||||||
<button class="nav-btn" id="theme-toggle" title="Basculer mode sombre">
|
<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>
|
<span>Basculer le thème</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -75,7 +75,7 @@ function getRightPanel() {
|
|||||||
<h4>Export</h4>
|
<h4>Export</h4>
|
||||||
<div class="nav-buttons">
|
<div class="nav-buttons">
|
||||||
<button class="nav-btn" id="export-md" title="Exporter en Markdown">
|
<button class="nav-btn" id="export-md" title="Exporter en Markdown">
|
||||||
<span class="icon">📝</span>
|
<span class="icon">↓</span>
|
||||||
<span>Exporter en Markdown</span>
|
<span>Exporter en Markdown</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user