fix 1.2.1 : cache index.md, H1 rendu, scroll wizard, titre Modifier

- ArticleManager : invalider le cache si index.md est plus récent que meta.json
- migration_001 : touch(meta.json) après maj index.md pour forcer l'invalidation
- post_view.php : masquer le H1 initial du contenu (déjà affiché par le template)
- step1.php : en-tête "Modifier" sans le titre de l'article
- wizard.js : retirer scrollToCursor (erroné sur auto-resize) ; Ctrl+Home/End via scrollIntoView

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 23:07:15 +02:00
parent 1dbe6d8dd3
commit 72cb7acae4
7 changed files with 29 additions and 27 deletions
+7 -20
View File
@@ -13,20 +13,13 @@ document.addEventListener('DOMContentLoaded', function () {
ta.addEventListener('input', resizeTa);
resizeTa();
function scrollToCursor() {
var lineH = parseFloat(getComputedStyle(ta).lineHeight) || 20;
var padT = parseFloat(getComputedStyle(ta).paddingTop) || 8;
var lines = ta.value.substr(0, ta.selectionStart).split('\n').length;
var cursorY = ta.getBoundingClientRect().top + padT + lines * lineH;
var margin = lineH * 3;
if (cursorY > window.innerHeight - margin) {
window.scrollBy({ top: cursorY - window.innerHeight + margin, behavior: 'instant' });
} else if (cursorY < margin) {
window.scrollBy({ top: cursorY - margin, behavior: 'instant' });
}
}
ta.addEventListener('keyup', scrollToCursor);
ta.addEventListener('click', scrollToCursor);
// Ctrl+Home / Ctrl+End : scroller la fenêtre vers le début/fin du textarea
ta.addEventListener('keydown', function (e) {
if (!(e.ctrlKey || e.metaKey) || (e.key !== 'Home' && e.key !== 'End')) return;
requestAnimationFrame(function () {
ta.scrollIntoView({ block: e.key === 'Home' ? 'start' : 'end', behavior: 'smooth' });
});
});
}
// ─── Ctrl+Enter soumet le formulaire ────────────────────────────────────
@@ -61,12 +54,6 @@ document.addEventListener('DOMContentLoaded', function () {
var data = await res.json();
if (data.ok) {
indicator.textContent = 'Sauvegardé à ' + data.time;
// Mettre à jour le titre de la page si le serveur l'a extrait
var pageTitle = document.getElementById('wz-page-title');
if (pageTitle && data.title) {
var prefix = pageTitle.dataset.prefix || '';
pageTitle.textContent = prefix ? prefix + data.title : data.title;
}
} else {
indicator.textContent = 'Erreur de sauvegarde';
}