Annotation IDs are now consistently hash-prefixed
This commit is contained in:
parent
8121aa38ec
commit
b8b126db68
|
@ -11,7 +11,7 @@ export default class WebAnnotation {
|
||||||
const stub = {
|
const stub = {
|
||||||
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
||||||
'type': 'Annotation',
|
'type': 'Annotation',
|
||||||
'id': uuid(),
|
'id': `#${uuid()}`,
|
||||||
'body': []
|
'body': []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default class Connection extends EventEmitter {
|
||||||
/** Initializes a fixed connection from an annotation **/
|
/** Initializes a fixed connection from an annotation **/
|
||||||
initFromAnnotation = function(contentEl, svgEl, annotation) {
|
initFromAnnotation = function(contentEl, svgEl, annotation) {
|
||||||
const [ fromId, toId ] = annotation.target.map(t => t.id);
|
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 fromNode = getNodeById(contentEl, fromId);
|
||||||
const fromBounds = new Bounds(fromNode.elements, svgEl);
|
const fromBounds = new Bounds(fromNode.elements, svgEl);
|
||||||
|
|
|
@ -88,7 +88,7 @@ export default class Selection {
|
||||||
const a = Object.assign({}, this._stub, {
|
const a = Object.assign({}, this._stub, {
|
||||||
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
'@context': 'http://www.w3.org/ns/anno.jsonld',
|
||||||
'type': 'Annotation',
|
'type': 'Annotation',
|
||||||
'id': uuid()
|
'id': `#${uuid()}`
|
||||||
});
|
});
|
||||||
|
|
||||||
return new WebAnnotation(a);
|
return new WebAnnotation(a);
|
||||||
|
|
Loading…
Reference in New Issue