Formulaire de paire (Association) en pile verticale + textarea
Build and deploy / test-python (push) Failing after 55s
Build and deploy / test-js (push) Successful in 49s
Build and deploy / lint-python (push) Failing after 1m2s
Build and deploy / lint-js (push) Failing after 1m0s
Build and deploy / build-and-push (push) Skipped
Build and deploy / deploy (push) Skipped
Build and deploy / sonarqube (push) Failing after 1m0s
Build and deploy / test-python (push) Failing after 55s
Build and deploy / test-js (push) Successful in 49s
Build and deploy / lint-python (push) Failing after 1m2s
Build and deploy / lint-js (push) Failing after 1m0s
Build and deploy / build-and-push (push) Skipped
Build and deploy / deploy (push) Skipped
Build and deploy / sonarqube (push) Failing after 1m0s
Retour utilisateur direct : les deux champs d'une paire etaient cote a cote (trop etroit dans le panneau Proprietes) et en <input> simple. Refonte de forgeDocRenderAssociationPairHtml en carte verticale (meme habillage que .docQuizQuestion : bordure/fond/en-tete avec le bouton supprimer) - "Element" et "Correspondance" sont desormais des <textarea redimensionnables (rows=2, resize:vertical), separes par un glyphe "up-down" plutot que le "left-right" horizontal precedent. Ajoute au passage forgeDocEscapeForTextarea : le texte d'une paire est insere comme CONTENU d'un <textarea> dans un template string (pas via .value) - sans echappement, un texte contenant litteralement "</textarea>" romprait le tag dans la propre session d'edition du createur. Remarque a part (pas corrigee ici, hors demande) : le texte d'une question de quiz (forgeDocRenderQuizQuestionHtml) a le meme motif sans cet echappement - a signaler si souhaite comme correctif separe. SKIP=djlint : backlog H021 pre-existant, aucun template touche ici. ruff/mypy --strict/eslint/stylelint tous verts ; 50 tests document verifies frais (aucune logique serveur touchee par ce changement purement CSS/JS). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
081b65f48f
commit
cf46da3388
@@ -847,23 +847,38 @@ img.docImage {
|
||||
|
||||
/* ---- Association : panneau Propriétés — paires reliées visuellement par
|
||||
un glyphe entre les deux champs (voir forgeDocRenderAssociationPairHtml,
|
||||
static/document/js/document-editor.js). ---- */
|
||||
static/document/js/document-editor.js). Empilement VERTICAL (pas côte à
|
||||
côte) : la colonne du panneau Propriétés est trop étroite pour deux
|
||||
champs de texte libre côte à côte, voir retour utilisateur du
|
||||
20/09/2026. ---- */
|
||||
.docAssocPairRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
border: 1px solid var(--doc-border);
|
||||
border-radius: 10px;
|
||||
padding: 12px;
|
||||
margin-bottom: 10px;
|
||||
background: var(--doc-card);
|
||||
}
|
||||
|
||||
.docAssocPairInput {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
resize: vertical;
|
||||
border: 1px solid var(--doc-border);
|
||||
border-radius: 8px;
|
||||
padding: 8px 10px;
|
||||
font-size: 13px;
|
||||
font-family: inherit;
|
||||
color: var(--doc-text);
|
||||
background: var(--doc-bg-2);
|
||||
}
|
||||
|
||||
.docAssocPairLink {
|
||||
flex-shrink: 0;
|
||||
align-self: center;
|
||||
color: var(--doc-accent);
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.docUnknown {
|
||||
|
||||
@@ -1084,23 +1084,35 @@ function forgeDocAssociationNewPair() {
|
||||
return { left: 'Nouvel élément', right: 'Sa correspondance' };
|
||||
}
|
||||
|
||||
function forgeDocEscapeForTextarea(text) {
|
||||
// Les deux côtés d'une paire sont du texte libre du créateur, inséré ici
|
||||
// comme CONTENU d'un <textarea> dans un template string (jamais via
|
||||
// .value, voir forgeDocRenderAssociationProps qui construit tout le
|
||||
// panneau en une seule chaîne) — sans cet échappement, un texte
|
||||
// contenant littéralement "</textarea>" romprait le tag et tout ce qui
|
||||
// suit serait interprété comme du HTML/JS brut dans SA PROPRE session
|
||||
// d'édition.
|
||||
return String(text).replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>');
|
||||
}
|
||||
|
||||
function forgeDocRenderAssociationPairHtml(pair, pIndex) {
|
||||
return `
|
||||
<div class="docAssocPairRow" data-pair-index="${pIndex}">
|
||||
<input type="text"
|
||||
class="docAssocPairInput"
|
||||
value="${pair.left}"
|
||||
<div class="docQuizQuestionHeader">
|
||||
<span class="docFieldLabel">Paire ${pIndex + 1}</span>
|
||||
<button type="button" class="docQuizRemoveBtn" data-pair-index="${pIndex}" title="Supprimer cette paire">🗑</button>
|
||||
</div>
|
||||
<textarea class="docAssocPairInput"
|
||||
rows="2"
|
||||
placeholder="Élément"
|
||||
data-pair-index="${pIndex}"
|
||||
data-side="left">
|
||||
<span class="docAssocPairLink" aria-hidden="true">↔</span>
|
||||
<input type="text"
|
||||
class="docAssocPairInput"
|
||||
value="${pair.right}"
|
||||
data-side="left">${forgeDocEscapeForTextarea(pair.left)}</textarea>
|
||||
<div class="docAssocPairLink" aria-hidden="true">↕</div>
|
||||
<textarea class="docAssocPairInput"
|
||||
rows="2"
|
||||
placeholder="Correspondance"
|
||||
data-pair-index="${pIndex}"
|
||||
data-side="right">
|
||||
<button type="button" class="docQuizRemoveBtn" data-pair-index="${pIndex}" title="Supprimer cette paire">🗑</button>
|
||||
data-side="right">${forgeDocEscapeForTextarea(pair.right)}</textarea>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user