Skip to content
Snippets Groups Projects
Commit a9a749f4 authored by Antoine Roy's avatar Antoine Roy
Browse files

refactoriser fragsel

parent e8f440dd
No related branches found
No related tags found
No related merge requests found
Pipeline #1700 failed
...@@ -330,11 +330,10 @@ class AnnotationCreation extends Component { ...@@ -330,11 +330,10 @@ class AnnotationCreation extends Component {
console.log('annotation in submitform', annotation) console.log('annotation in submitform', annotation)
console.log('config in submitform', config) console.log('config in submitform', config)
console.log('canvases in submitform', canvases) console.log('canvases in submitform', canvases)
console.log('tstart', tstart)
console.log('tstart & tend',tstart, tend) console.log('tstart & tend',tstart, tend)
const t = (tstart != null && tend != null) ? `${tstart},${tend}` : null; const timing = (tstart !== null && tend !== null) ? `${tstart},${tend}` : null;
const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody }; const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody };
console.log('t',t) console.log('t',timing)
canvases.forEach((canvas) => { canvases.forEach((canvas) => {
const storageAdapter = config.annotation.adapter(canvas.id); const storageAdapter = config.annotation.adapter(canvas.id);
...@@ -342,8 +341,9 @@ console.log('t',t) ...@@ -342,8 +341,9 @@ console.log('t',t)
title, title,
body, body,
canvasId: canvas.id, canvasId: canvas.id,
annotationTiming: timing,
fragsel: { fragsel: {
t, timing,
xywh, xywh,
}, },
id: (annotation && annotation.id) || `${uuid()}`, id: (annotation && annotation.id) || `${uuid()}`,
...@@ -449,7 +449,6 @@ console.log('t',t) ...@@ -449,7 +449,6 @@ console.log('t',t)
} }
const isVideoDataLoaded = mediaVideo && mediaVideo.video && !isNaN(mediaVideo.video.duration) && mediaVideo.video.duration > 0; const isVideoDataLoaded = mediaVideo && mediaVideo.video && !isNaN(mediaVideo.video.duration) && mediaVideo.video.duration > 0;
console.log(valueTime)
return ( return (
<CompanionWindow <CompanionWindow
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
export default class WebAnnotation { export default class WebAnnotation {
/** */ /** */
constructor({ constructor({
canvasId, id, fragsel, image, body, tags, svg, manifestId, title canvasId, id, fragsel, image, body, tags, svg, manifestId, title, annotationTiming
}) { }) {
this.title = title; this.title = title;
this.id = id; this.id = id;
this.annotationTiming = annotationTiming;
this.canvasId = canvasId; this.canvasId = canvasId;
this.fragsel = fragsel; this.fragsel = fragsel;
this.body = body; this.body = body;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment