Don't hard code base URL prefix
This commit is contained in:
parent
73cc9485f8
commit
24317a9eb2
@ -11,10 +11,7 @@ class Canvas {
|
|||||||
name = '';
|
name = '';
|
||||||
images = [];
|
images = [];
|
||||||
thumbnail = {};
|
thumbnail = {};
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {string} label
|
|
||||||
*/
|
|
||||||
constructor(IIIFApiVersion, baseURL) {
|
constructor(IIIFApiVersion, baseURL) {
|
||||||
this.context = `https://iiif.io/api/presentation/${IIIFApiVersion}/context.json`;
|
this.context = `https://iiif.io/api/presentation/${IIIFApiVersion}/context.json`;
|
||||||
this.BASE_URL = baseURL;
|
this.BASE_URL = baseURL;
|
||||||
@ -24,7 +21,7 @@ class Canvas {
|
|||||||
* @param {int|string} name A unique name for this canvas
|
* @param {int|string} name A unique name for this canvas
|
||||||
*/
|
*/
|
||||||
generateID(resourceId, name) {
|
generateID(resourceId, name) {
|
||||||
this.id = `${this.BASE_URL}/iiif/${resourceId}/canvas/${name}`;
|
this.id = `${this.BASE_URL}/${resourceId}/canvas/${name}`;
|
||||||
this.resourceId = resourceId;
|
this.resourceId = resourceId;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,8 @@ class Image {
|
|||||||
this.service['@id'] = this.id.replace(/\/full.*$/,'');
|
this.service['@id'] = this.id.replace(/\/full.*$/,'');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Object representation of
|
* Object representation of this image
|
||||||
* image resource
|
*
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
toObject() {
|
toObject() {
|
||||||
|
@ -26,7 +26,7 @@ class Manifest {
|
|||||||
* @param {string} resourceId From the request
|
* @param {string} resourceId From the request
|
||||||
*/
|
*/
|
||||||
generateID(resourceId) {
|
generateID(resourceId) {
|
||||||
this.id = `${this.BASE_URL}/iiif/${resourceId}/manifest` ;
|
this.id = `${this.BASE_URL}/${resourceId}/manifest` ;
|
||||||
this.resourceId = resourceId;
|
this.resourceId = resourceId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,7 @@ class Sequence {
|
|||||||
* @param {int|string} name A unique name for this sequence
|
* @param {int|string} name A unique name for this sequence
|
||||||
*/
|
*/
|
||||||
generateID(resourceId, name) {
|
generateID(resourceId, name) {
|
||||||
this.id = `${this.BASE_URL}/iiif/${resourceId}/sequence/${name}`;
|
this.id = `${this.BASE_URL}/${resourceId}/sequence/${name}`;
|
||||||
this.resourceId = resourceId;
|
this.resourceId = resourceId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user