Skip to content
Snippets Groups Projects
Commit 2c8661d1 authored by Anthony's avatar Anthony
Browse files

WIP Saving fake data

parent bd700549
No related branches found
No related tags found
1 merge request!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1909 failed
...@@ -11,6 +11,7 @@ const config = { ...@@ -11,6 +11,7 @@ const config = {
exportLocalStorageAnnotations: false, // display annotation JSON export button exportLocalStorageAnnotations: false, // display annotation JSON export button
}, },
catalog: [ catalog: [
{ manifestId: 'https://files.tetras-libre.fr/dev/Hakanai/manifest/manifest.json' },
{ manifestId: 'https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/manifest.json' }, { manifestId: 'https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/manifest.json' },
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0219-using-caption-file/manifest.json' }, { manifestId: 'https://iiif.io/api/cookbook/recipe/0219-using-caption-file/manifest.json' },
{ manifestId: 'https://preview.iiif.io/cookbook/master/recipe/0003-mvm-video/manifest.json' }, { manifestId: 'https://preview.iiif.io/cookbook/master/recipe/0003-mvm-video/manifest.json' },
......
...@@ -53,6 +53,7 @@ function AnnotationCreation(props) { ...@@ -53,6 +53,7 @@ function AnnotationCreation(props) {
let tend; let tend;
const annoState = {}; const annoState = {};
if (props.annotation) { if (props.annotation) {
console.log('props.annotation', props.annotation);
// annotation body // annotation body
if (Array.isArray(props.annotation.body)) { if (Array.isArray(props.annotation.body)) {
annoState.tags = []; annoState.tags = [];
...@@ -100,6 +101,12 @@ function AnnotationCreation(props) { ...@@ -100,6 +101,12 @@ function AnnotationCreation(props) {
setDrawingState(JSON.parse(props.annotation.drawingState)); setDrawingState(JSON.parse(props.annotation.drawingState));
} }
} }
// TODO add a case where no annotation
if(!annoState?.textBody) {
annoState.textBody = '';
}
// If we don't have tstart setted, we are creating a new annotation. // If we don't have tstart setted, we are creating a new annotation.
// If we don't have tend setted, we set it at the end of the video. // If we don't have tend setted, we set it at the end of the video.
...@@ -114,7 +121,6 @@ function AnnotationCreation(props) { ...@@ -114,7 +121,6 @@ function AnnotationCreation(props) {
mediaVideo: props.mediaVideo, mediaVideo: props.mediaVideo,
...annoState, ...annoState,
tend, tend,
textBody: '',
textEditorStateBustingKey: 0, textEditorStateBustingKey: 0,
tstart, tstart,
valueTime: [0, 1], valueTime: [0, 1],
......
...@@ -11,7 +11,7 @@ export default class WebAnnotation { ...@@ -11,7 +11,7 @@ export default class WebAnnotation {
this.tags = tags; this.tags = tags;
this.svg = svg; this.svg = svg;
//this.image = image; //this.image = image;
this.image = null; this.image = image;
this.manifestId = manifestId; this.manifestId = manifestId;
this.drawingState = drawingStateSerialized; this.drawingState = drawingStateSerialized;
...@@ -52,10 +52,9 @@ export default class WebAnnotation { ...@@ -52,10 +52,9 @@ export default class WebAnnotation {
}; };
//bodies.push(imgBody); //bodies.push(imgBody);
const testImageBody = { const testImageBody = {
"id": "http://iiif.tetras-libre.fr/data/Hakanai/media/10_HKN-Garges_A2B4243.JPG", "id": "https://files.tetras-libre.fr/dev/Hakanai/media/10_HKN-Garges_A2B4243.JPG",
"type": "Image", "type": "Image",
"format": "image/jpg", "format": "image/jpg"
"value": "<a href=\"http://iiif.tetras-libre.fr/data/Hakanai/media/10_HKN-Garges_A2B4243.JPG\" target=\"_blank\">Dispositif</a>"
}; };
bodies.push(testImageBody); bodies.push(testImageBody);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment