Annotation IDs are now consistently hash-prefixed

This commit is contained in:
Rainer Simon 2020-04-28 11:49:26 +02:00
parent 8121aa38ec
commit b8b126db68
3 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ export default class WebAnnotation {
const stub = {
'@context': 'http://www.w3.org/ns/anno.jsonld',
'type': 'Annotation',
'id': uuid(),
'id': `#${uuid()}`,
'body': []
};

View File

@ -52,7 +52,7 @@ export default class Connection extends EventEmitter {
/** Initializes a fixed connection from an annotation **/
initFromAnnotation = function(contentEl, svgEl, annotation) {
const [ fromId, toId ] = annotation.target.map(t => t.id);
const relation = annotation.bodies[0].value; // Temporary hack
const relation = annotation.bodies[0].value;
const fromNode = getNodeById(contentEl, fromId);
const fromBounds = new Bounds(fromNode.elements, svgEl);

View File

@ -88,7 +88,7 @@ export default class Selection {
const a = Object.assign({}, this._stub, {
'@context': 'http://www.w3.org/ns/anno.jsonld',
'type': 'Annotation',
'id': uuid()
'id': `#${uuid()}`
});
return new WebAnnotation(a);