From e1c1e6e32c54fe9b59036fd5348c6c0142816719 Mon Sep 17 00:00:00 2001 From: Antoine <antoine.roy@tetras-libre.fr> Date: Thu, 11 Jan 2024 11:45:42 +0100 Subject: [PATCH] =?UTF-8?q?correctif=20pour=20que=20le=20title=20soit=20da?= =?UTF-8?q?ns=20le=20body=20et=20bien=20affich=C3=A9=20en=20haut=20du=20pa?= =?UTF-8?q?nel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirador | 2 +- src/AnnotationCreation.js | 7 ++----- src/WebAnnotation.js | 4 +--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mirador b/mirador index fd236dc..3956139 160000 --- a/mirador +++ b/mirador @@ -1 +1 @@ -Subproject commit fd236dcb8581ca647b90793e29578fbdd2709bc0 +Subproject commit 3956139233904c4666e611a2b3aa09143cb67b57 diff --git a/src/AnnotationCreation.js b/src/AnnotationCreation.js index 8460aeb..dbd0b53 100644 --- a/src/AnnotationCreation.js +++ b/src/AnnotationCreation.js @@ -144,7 +144,6 @@ class AnnotationCreation extends Component { ...annoState, valuetextTime: '', mediaVideo: null, - title: 'defaultTitle', }; this.submitForm = this.submitForm.bind(this); @@ -327,7 +326,6 @@ class AnnotationCreation extends Component { } = this.state; const t = (tstart && tend) ? `${tstart},${tend}` : null; const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody }; - canvases.forEach((canvas) => { const storageAdapter = config.annotation.adapter(canvas.id); @@ -429,6 +427,7 @@ class AnnotationCreation extends Component { image, valueTime, mediaVideo, + title } = this.state; // TODO : Vérifier ce code, c'est étrange de comprarer un typeof à une chaine de caractère. @@ -437,12 +436,10 @@ class AnnotationCreation extends Component { valueTime[0] = tstart; valueTime[1] = tend; } - const isVideoDataLoaded = mediaVideo && mediaVideo.video && !isNaN(mediaVideo.video.duration) && mediaVideo.video.duration > 0; - return ( <CompanionWindow - title={annotation ? annotation.title : 'New Annotation'} + title={title ? title.value : 'New Annotation'} windowId={windowId} id={id} > diff --git a/src/WebAnnotation.js b/src/WebAnnotation.js index b9a3d7f..c140364 100644 --- a/src/WebAnnotation.js +++ b/src/WebAnnotation.js @@ -4,7 +4,7 @@ export default class WebAnnotation { constructor({ canvasId, id, fragsel, image, body, tags, svg, manifestId, title }) { - this.title = title; + this.title = title, this.id = id; this.canvasId = canvasId; this.fragsel = fragsel; @@ -18,7 +18,6 @@ export default class WebAnnotation { /** */ toJson() { return { - title: this.title, body: this.createBody(), id: this.id, motivation: 'commenting', @@ -46,7 +45,6 @@ export default class WebAnnotation { }; bodies.push(imgBody); } - if(this.title){ const title={ type: 'AnnotationTitle', -- GitLab